PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: SeaVipe on September 06, 2018, 03:47:11 PM

Title: WinFBE - WinFBE.ini - Observation
Post by: SeaVipe on September 06, 2018, 03:47:11 PM
Hi Paul,


    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.
Title: Re: WinFBE - WinFBE.ini - Observation
Post by: José Roca on September 06, 2018, 04:08:27 PM
The file is unicode. Therefore, use pTxtStm.OpenUnicode instead of pTxtStm.Open.

You can also use pTxtStm.OpenForInputW(cbsFile).
Title: Re: WinFBE - WinFBE.ini - Observation
Post by: SeaVipe on September 06, 2018, 05:47:27 PM
Thanks, José