PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE - WinFBE.ini - Observation  (Read 157 times)

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 124
  • Windows 10
WinFBE - WinFBE.ini - Observation
« on: September 06, 2018, 03:17:11 PM »

Hi Paul,

Code: [Select]
    DIM pTxtStm AS CTextStream

    ' // Open file as a text stream
    DIM cbsFile AS CBSTR = "C:\WinFBE_Suite\Settings\WinFBE.ini"

    pTxtStm.Open( cbsFile, IOMode_ForReading )
     
    ' // Read the file sequentially
    Dim as byte bLine = 0
   
    Print "Begin }---------------------------------------------"
   
    Do Until bLine >= 10 Or pTxtStm.EOS
       
       bLine += 1
       
       DIM cbsText AS CBSTR = pTxtStm.ReadLine

       PRINT bLine; ">"; cbsText; "<"

    Loop
   
    Print
    Print
    Print "For reference, here are the 10 lines cut and paste from the ini file with line numbers added:"   
    PRINT "1  '  WINFBE CONFIGURATION"
    Print "2"
    PRINT "3  WinFBEversion=1.7.9"
    Print "4"
    PRINT "5  [Editor]"
    PRINT "6  AskExit=0"
    PRINT "7  HideToolbar=0"
    PRINT "8  HideStatusbar=0"
    PRINT "9  MultipleInstances=1"
    PRINT "10 CompileAutosave=1"
   
    Print "End }-----------------------------------------------"

    pTxtStm.Close
The output is shown in the attached image.
I can open WinFBE.ini in Notepad++ (which is where I cut and paste for reference.)
BTW, I got the version number from changes.txt using the same code but with a different file name.
Logged
Clive Richey

Josť Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3109
    • Jos
Re: WinFBE - WinFBE.ini - Observation
« Reply #1 on: September 06, 2018, 03:38:27 PM »

The file is unicode. Therefore, use pTxtStm.OpenUnicode instead of pTxtStm.Open.

You can also use pTxtStm.OpenForInputW(cbsFile).
« Last Edit: September 06, 2018, 03:46:19 PM by Josť Roca »
Logged

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 124
  • Windows 10
Re: WinFBE - WinFBE.ini - Observation
« Reply #2 on: September 06, 2018, 05:17:27 PM »

Thanks, Josť
Logged
Clive Richey