| Terminal Input and Output |
|
| Prior Next | |
|
Displaying data on the user terminal is the function of the PRINT directive . It can format and output a list of variables and literals on the user terminal. It also supports the ability to position the output on the terminal screen and allows insertion of special terminal control codes through the use of mnemonics . The basic format of the PRINT directive is:
Where:
list A list (comma separated) of variables, literals, expressions, mnemonics, or screen positions.
All data to be sent to a terminal must be in ASCII. String variables and string literals are maintained in ASCII, thus are sent to the terminal as is. Numeric data is maintained in binary format and is converted to ASCII automatically by the PRINT directive. (See Numeric Format Masks and Unformatted Numeric Output )
| |
| *Note* |
It is important that string variables only contain printable characters. Attempting to print control sequences to a terminal may cause in unpredictable results. |
|
By default, each PRINT directive advances one line on the terminal after outputting the data. This automatic advance can be overridden by terminating the output list with an extra comma, in which case data from the next PRINT is appended to the current line.
| |
|
Example: |
Simple terminal output and hanging comma
The PRINT directive can also be used for outputting data to printers or files which are to be printed later. See File Handling for more information.
|
| Prior Next |