EasyManua.ls Logo

Atari ST series - Page 100

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CHAPTER 5
In addition to the normal character input and output
functions, GEMDOS provides an unusual function that al
lows you either to send characters to the console device or
receive them. The macro name for this function is Crawio(),
and it's called like this:
int chin, chout;
chin = Crawio(chout);
where chout is a word whose high byte is 0, and whose low
byte contains either a character to be printed, or a flag that
signals the function to check the console keyboard for input.
If a value from 0-254 is placed in the low byte of chout, that
character is printed on the console screen at the current cursor
position. Control codes and escape sequences are interpre
ted normally (see Appendix E for a complete description). If
the low byte of chout contains a value of 255 (OxFF), the func
tion tests the console keyboard for input. If no characters are
available for input, both the high and low bytes of chin are set
to 0. If a character can be read, however, the low byte of chin
contains the ASCII value of the character, while the high byte
contains its scan code (see Appendix J for a complete list
of key codes). Thus, the input portion of Crawio() combines
both status and input functions in a single call. Crawcio()
does not echo the character that it reads to the screen.
In addition to functions that input or output a single
character at a time, GEMDOS contains functions that let you
use the console device to input or print a whole string of
characters at once. The output function is called Cconws(),
and its syntax is as follows:
int length;
char *string;
length = Cconws(string);
where string is a pointer to a null-terminated string of text
characters of any length. Control characters and escape se
quences are interpreted as usual. Upon return,
length con
tains the number of characters that were printed.
The read string function, Cconrs(), is a little more com
plex, and a little more peculiar. It not only reads in a whole
string, echoing each character out to the screen as it is read,
but provides some line-editing functions as well. A typical
call to this function might look like this:
92

Related product manuals