Jump to content

Weird behavior of FileReadLine


Recommended Posts

I have recently upgraded to AutoIt v.84. Since, I'm experiencing problems on FileReadLine function. It looks like the function reads only the first line! Is there a problem wit my code? :whistle:

10x

$cfgFile = FileOpenDialog( "Choose a cfg file", "", "cfg file (*.cfg)", 1 )
If $cfgFile="0" Then
    Exit
EndIf
$handle = FileOpen ($cfgFile, 0)
If $handle = -1 Then
    MsgBox (0, "Error", "There was a problem opening the cfg file. Make sure it is closed")
    Exit
EndIf

;cfg file is now open. Now reading it's content.
While 1
    $line = FileReadLine($cfgFile)
    If @error = -1 Then
      ExitLoop
    EndIf
    Msgbox (0,"Line content", $line)
Wend

FileClose($handle)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...