The !SCREEN() subroutine performs screen based input using a screen definition created using the SCRB command.
CALL !SCREEN(scrn, data, step, status)
|scrn||is a dynamic array holding the screen definition.|
|data||is the data record to be processed.|
|step||holds the step number at which screen execution is to commence. If this is a variable, it will be updated on exit to contain the step at which execution ended.|
|status||identifies the termination cause on returning to the calling program.|
The !SCREEN() subroutine executes the screen starting at step except for the special step values described below.
|0||Clear the screen and paint text and data from all steps except those items with X in their mode value.|
|-1||Paint text and data from all steps except those items with X in their mode value without clearing the screen.|
|-2||Clear the screen without painting any data.|
|-3||Return a single keystroke value.|
On returning to the calling program, status contains
|-3||Illegal exit key code found in screen definition.|
|-2||Illegal validation code found in screen definition.|
|0||Normal exit (X action code)|
|1||Exit key (escape) used with action code X|
|2||Backstep key used with no step history.|
|n||Function key used. n is the key value as in KEYIN.H.|
READ SCRN FROM SCR.F, 'MY.SCREEN' ELSE ABORT 'Cannot read screen'
DATA = ''
CALL !SCREEN(SCRN, DATA, STEP, SCR.STATUS)
The above code fragment reads a screen definition and executes the screen driver to process the data record using this definition.