DATA


The DATA statement stacks the series of expressions on an input FIFO stack. Terminal input statements will then treat this data as if it was typed in at the keyboard.

 

COMMAND SYNTAX

DATA expression {, expression ...}

 

SYNTAX ELEMENTS

The expression may evaluate to any data type. Each comma separated expression will be viewed as one line of terminal input.

 

NOTES

The DATA statement cannot be used to send input to the jBC IN statement in that the IN statement reads from a different place than the INPUT statement. The INPUT statement reads from stdin and IN reads from the 'raw' device (normally the keyboard). The DATA statement only sends to stdin and terminates each line with a <cr>, so the code:

DATA 'A'
IN X

will 'block' until a character is entered at the keyboard, and the 'A' will be lost when the program terminates.

The data stacked for input will subsequently be treated as input by any jBC program (with the exception of the IN statement as previously mentioned). Therefore it may be used before PERFORM/EXECUTE, CHAIN or any other method of transferring program execution. It may also be used to stack input for the currently executing program but cannot be used to stack input back to an executing program.

When stacked data is detected by a jBC program, it is taken as keyboard input until the stack is exhausted. The program will then revert to the terminal device for subsequent terminal input.

Stacked data delimited by field marks (xFE) will be treated as a series of separate terminal inputs.

See also CLEARDATA.

 

EXAMPLES

DATA "Y", "N", "CONTINUE" ;* stack input for prog
EXECUTE "PROGRAM1" ;* execute the program


jBC