Atari ST series Technical Reference Manual page 101

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

GEMDOS Device I/O and Process Control
char buffer[82];
int length;
buffer[0] = 80;
length = Cconrs(buffer);
buffer[length + 2] = 0;
Before calling the function, first set up a buffer, into
which the function may read the characters. You must also
store the maximum number of characters that may be read in
the first byte of the buffer. Here, an 82-byte buffer was de­
clared to hold a maximum of 80 input characters. The extra
two bytes are for the string formatting information that ap­
pears at the beginning of the buffer. The first byte is the
maximum string length, which your program must set, and
the second byte is the actual length of the string returned by
Cconrs(). If you plan to output the string, using a function
such as Cconws(), terminate it with a 0 character. To print
the line, you could use the statement
Cconws(buffer + 2);
When your program calls Cconrs(), you may start enter­
ing characters from the keyboard. These characters will ap­
pear on the screen as you type them. The Cconrs() call does
not return until the user signals that the entire string has
been entered. He does this by pressing one of the terminat­
ing key combinations such as Return (carriage return), Con-
trol-J (linefeed), or Control-M (carriage return). The function
also returns if the user enters the maximum number of char­
acters, as stored in the first byte of the buffer.
While the user is entering characters, certain control
characters act as line-editing functions. These are similar to
the console device line-editing functions available under the
CP/M and MS-DOS operating systems. The table below
shows the line-editing characters and their functions:
Control Character
Control-C
Control-H
Control-I
Control-J
Control-M
Control-R
Control-U
Control-X
Editing Function
End input and terminate program
Backspace
Tab
Linefeed, end input
Carriage return, end input
Skip to next line, reprint original line
Skip to next line, start new line
Erase to beginning of line
93

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents