Archive: Help me reading files. PLEASE!!!


Help me reading files. PLEASE!!!
I'm trying to write a routine to read a file (text).
I'm using the following routine but the program cannot
escape from the loop... Please help me correct this!!!

Function "FileReader"
FileOpen $0 "File" "r"
loop:
FileRead $0 $1
IfErrors Exit
DetailPrint "$1"
Goto loop:
Exit:
FunctionEnd

Can you find my mistake? Tell me please...

Thx, greetz, Smile2Me.


There seems to be a bug in FileRead and you've found it :(

You can get around it though - replace

IfErrors Exit

with
StrCmp $1 "" Exit

This will not stop on blank lines because they still have \r\n at the end so it should work OK.

Dave Laundon.

Thx
Dave,

thanks a lot for your help.
I will try it!!!
I hope the bug in FileRead will be fixed in later versions...


Thx, Hendri Adriaens (:D Smile2Me).