Doc,

You're right - readline() returns a chr(0) when reading empty files (and I was using RC3 in my testing) ... would this be a suitable work-around (given that your reading a text file - should be no CHR(0)'s in there ?) :

code:

BREAK ON
$CHK = ""
$logfile = "C:\RC.TXT"
$ = OPEN(1,$logfile,2)
IF @error = 0
$x = readline(1)
?"@ERROR"
while @error = 0 and $x <> CHR(0)
if instr($x,"rtvscan.exe")
$CHK = "Running"
endif
$x = readline(1)
LOOP
$ = CLOSE(1)
ENDIF
?"CHK=$CHK"
EXIT 1

-Shawn

Or maybe, when you create the RC.TXT file, you can throw in an extra byte or two at the end (guarantee at least two in the file) and avoid this prob. altogether - say, by echo/appending some extra chars ?

[ 26 October 2001: Message edited by: Shawn ]