Sign in to follow this  
Followers 0
BlueScreen

Weird behavior of FileReadLine

2 posts in this topic

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)

Share this post


Link to post
Share on other sites



10x Larry. Boy, I'm stupid...

:iamstupid:

Share this post


Link to post
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
Sign in to follow this  
Followers 0