Hi Jochen and/or others members...

I have another question about this parsing.

If the file size is 0 it keeps looping. If it is empty except for a carriage return then it is okay.

How can I prevent the looping when the file size is 0 ?

I added checking code, but is it possible some other way in the looping code?

code:

$CHK = "Unknown"
BREAK ON
$Fsize = GETFILESIZE ("C:\RC.TXT")
IF $Fsize = 0
?"File size $Fsize is too small to work with."
GOTO END
ELSE
?"File size $Fsize is okay to work with."
GOSUB TEST
? "Hello... were back now. "
? "The CHK value is: " $CHK
ENDIF

:TEST ; Checks if the NAV Service is running on Windows NT/2000/XP systems.
$logfile = "C:\RC.TXT"
$ = OPEN(1,$logfile,2)
IF @error = 0
$x = readline(1)
IF $x OR asc($x) = $crlf
DO
SELECT
CASE instr($x,"rtvscan.exe")
$CHK = "Running"
ENDSELECT
$x = readline(1)
UNTIL @error
ENDIF
ENDIF
$ = CLOSE(1)
RETURN

:END