User`s guide

Terminal I/O
The program instruction used to output text to the monitor screen is TYPE. The program
line:
TYPE "This is a terminal output instruction."
outputs the text between the quotation marks to the current cursor location. If a variable x
has a value of 27, the instruction:
TYPE "The value of x is ", x, "."
outputs
The value of x is 27.
to the monitor.
The TYPE instruction has qualifiers for entering blank spaces and moving the cursor. The
instruction:
TYPE /C34, /U17, "This is the screen center."
enters 34 carriage returns (clear the screen), move up 17 lines from the bottom of the
screen, and output the text message. Additional qualifiers are available to format the output
of variables and control terminal behavior.
The program instruction used to retrieve data input from the keyboard is PROMPT. The
program line:
PROMPT "Enter a value for x: ", x
halts program execution and wait for the operator to enter a value from the keyboard (in this
case a real or integer value). If a value of the proper data type is entered, the value is
assigned to the named variable (if the variable does not exist, it is created and assigned the
value entered) and program execution proceeds. If an improper data type is entered, the
system generates an error message and halts execution. String data is expected if a string
variable ($x, for example) is specified.
All terminal input should be verified for proper data type. The following code segment
ensures that a positive integer is input. (Using the VAL() function also guarantees that
inadvertently entered nonnumeric characters do not cause a system error.)
DO
PROMPT "Enter a value greater than 0: ", $x
x = VAL($x)
UNTIL x > 0
Terminal I/O
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 201