The LINES() built-in function can do one of two things:
1) It can tell you if there is at least one more line to be read from a file.
2) It can tell you exactly how many more lines can be read from a file.
The way to tell LINES to do #1 is to pass a second argument of 'N' like so:
IF LINES('C:\MyFilename', 'N') > 0 THEN
SAY "Yes, there is another line to read."
ELSE
SAY "No, there is not another line to read." Here's how you find out exactly how many more lines need to be read:howmany = LINES('C:\MyFilename')
SAY "There are" howmany "more lines to read." The time it takes to do #2 is a lot longer than the time it takes to do #1. So, if you're using LINES just to find out if there is another line to read (for example, using it to determine whether to loop around and read another line, then definitely pass the second arg of "N". That could speed up your loop).
For more information, read the REXX Reference book: chapter "Files/Directories/Devices (Streams)", page "Reading a file", under the section "Determine how many lines can be read". |