Definition: | integer i = getc(integer fn) |
Description: | Get the next character (byte) from file or device fn. The character will have a value from 0 to 255. -1 is returned at end of file. |
Comments: | File input using getc() is buffered, i.e. getc() does not actually
go out to the disk for each character. Instead, a large block of
characters will be read in at one time and returned to you one
by one from a memory buffer.
When getc() reads from the keyboard, it will not see any characters until the user presses Enter. Note that the user can type control-Z, which the operating system treats as "end of file". -1 will be returned. getc0() is a low-level equivalent of {} = getc(0), aka if getc(0) then end if, see builtins\puts1[h].e (not an autoinclude) |
See Also: | gets, get_key, wait_key, open |