I want to read the contents of a file (info.txt) to a messagebox on the screen. The file contains a couple of lines like:

last changes: October 23rd
fixed: update.exe, update.txt
changed by: mmo/ict

The file can also contain more lines than the three I mentioned above.

I want my script to read the lines from info.txt and display all the lines in one messagebox. The readline(x) statement has to continue untill there is no more input from the info.txt file. If the file info.txt contains 3 lines, it should stop at the 4th.

I already created something like this


code:
 
IF Open(2, "info.txt") = 0
$r= readline(2)
While instr("$r","stop!") = 0
$r=$r + ReadLine(2) + chr(13) + chr(10)
Loop
$Selection = MessageBox("There is a update available

update info:

$r
Continue with the update?", "Update", 0)
Endif
Close (2)


A few problems remain...

There has to be a line containing 'stop!' in the file to stop the input from the info.txt file. This is a very simple flag and I think this can be done a lot nicer.

All the lines read from info.txt have to be displayed below each other in the messagebox. What's the correct CHR code to do so? chr(13)+chr(10) doesn't seem to do the trick.

Anyone got a better solution?

Mac