The Chars function returns a how many characters remain to be read from an input stream, following the current read position. If the file system uses line separators, the count includes the number of these as well.
Portability note: some implementations are unable to determine how many characters remain and return 1 when an undetermined number of characters remain, and 0 otherwise.
When the default input stream is associated with keyboard input, the number of characters remaining can not be determined.
result = Chars( [ stream ] ) |
Examples:
say Chars() -- shows how many characters can be read from the default input stream -- 0 or 1(indeterminate). say Chars( '' ) -- shows how many characters can be read from the default input stream -- 0 or 1(indeterminate). say Chars( 'file1' ) -- shows how many characters can be read from the stream named 'file1'
/* convert characters to uppercase * input is from the default input stream * output is to the default output stream */ do while chars() > 0 call charout , translate( charin() ) end |