Bummer - Things not that good here Shawn. Many good people have left or been laid off here at the Mouse.Sorry Jochen,
My real script has the $CRLF defined.
I have tested both of your scripts and both of them seem to go into an endless loop with a file size of Zero bytes.
Code Sample 1
code:
$crlf = chr(13)+chr(10) ;chr(13) is a Carriage Return and chr(10) is a line feed
$CHK = "Unknown"
BREAK ON
$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)
Code Sample 2
code:
BREAK ON$CHK = ""
$logfile = "C:\RC.TXT"
$ = OPEN(1,$logfile,2)
IF @error = 0
$x = readline(1)
while @error = 0
if instr($x,"rtvscan.exe")
$CHK = "Running"
endif
$x = readline(1)
LOOP
$ = CLOSE(1)
ENDIF
?"CHK=$CHK"
EXIT 1
As I said before, if there is "anything" in the file the code works fine. If it has a size of at lest 2 bytes "a $cr" it works. If it has nothing it loops forever till you break out of it manually.
I'm using KiXtart v3.63 on Windows 2000 Pro SP2
NOTE:
I just now tested this on KiXtart 2001 RC3 and it works fine. It DOES NOT work on KiXtart v3.63 Is this a bug or some other known issue?