


A routine can communicate with the user via terminal screen forms (see chapter General Points on Forms and Menus) or via row-oriented READ/WRITE statements.

After WRITE there is a list of expressions and control options. The values of the expressions are calculated and written on to the screen in the order of their occurrence or the control options are executed.
All control options are optional.
If not something else has been declared by means of control options, WRITE separates the output values from each other by blanks and writes only to the end of the current screen line.
The WRITE statement outputs the NULL value in the representation which is set in the SET parameters.
The following control options are available for the WRITE statement:
CLEAR clears the screen and assumes the left-hand top corner as current position. This statement makes sense if the screen needs to be cleared explicitly (see automatic clearing of the screen when using the Line-oriented Input and Output statement). Since the control options are executed in the order in which they are noted, the CLEAR control option only makes sense at the beginning of a list of expressions.
CLEAR (l, c) clears a rectangle from the current cursor position l lines downward and c columns to the right.
NOCLEAR prevents the screen from being cleared when the edge of the screen is reached while executing the NL statement.
NL, NL(n) shifts the current position one or n lines forward (n line feeds) to the beginning of the line. If the screen edge is reached while NL(n) is being executed, the next line feed has the effect of the CLEAR statement.
COL(n) positions the cursor in the current line to the n-th column to the right. The control option can only position forwards. If the current position lies to the right of the desired column, COL does not have any effect.
HI(<expresn. Expressions behind the HI control option enclosed in parentheses
list>) are highlighted. The subsequent expressions appear with the previously valid intensity.
HIGH All expressions following the control option HIGH are highlighted.
PAUSE causes a confirmation to be requested from the user (e.g. pressing the
~key).
SIZE(n) Normally, an expression is output with its current length. The SIZE control option causes the following expression to be output in the length specified by SIZE. If the length specified by SIZE is shorter than the current length of the expression, it is truncated. If it is longer, the expression is filled with blanks to the specified length. The length n can also be formulated as a numeric expression.
POS(l, c) indicates the absolute co-ordinates of the current position. The first parameter (l) specifies the line number, the second (c) the column number. Line and column numbers can also be formulated as numeric expressions. The POS control option, however, has an effect only when the following applies:
1<= l <= number of representable screen lines
1<= c <= number of representable characters per line
OPEN,
CLOSE The OPEN control option causes all the following WRITE output not to be displayed on the screen but to be held in background. The terminal screen output with the data gathered so far is explicitly released by the control option CLOSE or PAUSE. The terminal screen output is also automatically released when the edge of the screen is reached by a WRITE statement.
HOLD has the effect that the user has to press a release key so that a full screen is automatically cleared. In the right-hand lower corner of the screen '...HOLDING' appears. After the release key is pressed, the screen is cleared and the output is continued.
The READ statement processes a list of variables and control options in the given order. Like the WRITE statement, the READ statement, too, separates the input fields from each other by blanks, if nothing else has been declared via control options. A READ statement can contain several variables that are read in the order in which they are written. A READ statement that does not contain any variables does not have any effect.
The following control options are available for the READ statement:
variable causes an input field to appear at the current position. The user can type in a value and terminate the input with a release key. The value read in is then stored as the value of the variable. If no further control options have been specified, the field stretches to the edge of the screen and is filled with blanks. When filling the field, the characters appear with normal intensity. If the user does not input anything for the variable, it takes on the NULL value.
HIGH causes the characters entered when filling a field to appear with highlighted intensity.
DARK causes the characters input not to appear on the screen (no echo).
NL, NL(n) changes the current position as in the WRITE statement.
COL(n) changes the current position as in the WRITE statement.
POS(l, c) changes the current position as in the WRITE statement.
SIZE(n) restricts the size of the input field to the length specified in SIZE.
CLEAR clears the screen as in the WRITE statement.
PROMPT 'c' causes the input field to be filled with the character specified with PROMPT (otherwise blanks).
OUTIN (v) causes the current value of the variable v to be displayed in the input field. If the variable has the value NULL, the field appears either filled with blanks or, if a PROMPT control option has preceded, with the PROMPT character.
Example 1:

Effect:

Since no position was specified in the READ statement, the input field 'answer' is output immediately behind the written text. After inputting a value, SQL-PL continues the processing with the next WRITE and READ statement and waits for the variable value 'today' to be input.

Syntax:



