# DATA

Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)

# Description

The DATA statement stacks the series of expressions on a terminal input FIFO stack. Terminal input statements will then treat this data as if entered at the keyboard.

DATA expression {, expression ...}
1

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

# Note

The data stacked for input will subsequently be treated as input by any jBASE BASIC program.

Therefore use it before PERFORM/EXECUTE, CHAIN or any other method of transferring program execution. Use also to stack input for the currently executing program; do not use to stack input back to an executing program.

When a jBASE BASIC program detects stacked data, 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. An example of use is as:

PROGRAM Example1
DATA "Y", "N", "Continue" ;* stack input for Program1
EXECUTE "Program1"        ;* execute the Program
1
2
3
PROGRAM Example2
DATA "Y" : @AM : "N" : @AM : "Continue"; * stack input for Program1
EXECUTE "Program1"; * execute the Program
1
2
3

Program1 can simply be:

PROGRAM Program1
INPUT reply1
INPUT reply2
INPUT reply3
CRT reply1, reply2, reply3
1
2
3
4
5

Running either Example1 or Example2 will produce the same result:

jsh ~ -->Example1
Y       N       Continue
jsh ~ -->
1
2
3

See also: CLEARDATA

Go back to jBASE BASIC

Go back to Programmers' Reference Guide