omron — GETC real-valued function

GETC real-valued function of records are also returned. When the end of a disk file is reached, a Ctrl+Z character (26 decimal) is returned. When reading from the terminal, GETC will return the next character entered at the keyboard. All control characters will be read, except Ctrl+S, Ctrl+Q, Ctrl+O, and Ctrl+W, which will have their normal terminal control functions. When reading from the serial line, GETC will return the next data byte immediately, unmodified.

(Note that if the serial line is configured to recognize Ctrl+S and Ctrl+Q automatically as control characters, then those characters are not returned by the GETC function.) Normally, the byte value returned is in the range 0 to 255 (decimal). If an input error occurs, a negative error code number is returned. The meanings of the error codes are listed in the section System Messages. Example The following program segment reads characters from a disk file until a comma (,) character, a control character, or an I/O error is encountered. The characters are appended to the string variable $field.

(The disk file must have already been opened for accessing variable-length records.) $field = "" c = GETC(5) WHILE (c > ^H1F) AND (c ',) DO $field = $field+$CHR(c) c = GETC(5) END IF c 0 THEN TYPE $ERROR(c) HALT END Related Keywords ATTACH program instruction READ program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 267