
REXX: LINES() and "complete lines"
In this posting I ask a question about REXX in general and one about
a specific implementation. But the two are closely related; that's why
I'm crossposting to comp.lang.rexx and to comp.os.os2.programmer.misc.
"The REXX Language - Second Edition" says that LINES(name) returns the
number of "complete lines" currently remaining in the input stream name.
What is a complete line in this context?
My common sense tells me that if the read position is somewhere in the
middle of the last line of a file, there are no more complete lines
available, and LINES(file) should return 0.
Under OS/2 2.1, the built-in REXX interpreter (it's version string is
"REXXSAA 5.00 08 Jul 1992") "thinks" differently. If the read position
is somewhere in the middle of the last line of a file, LINES(file) still
returns 1. It only returns 0 (while CHARS() still returns a postitive
value) if the read position is 1 character before the end of the file.
This even is the case when the last line of the file isn't terminated by
a line end sequence. This seems to be a bug. Can anyone confirm this?
Horst
- - - - - - - - - - - - - - - - - - - - - - -