DATA

DATA


CRT Index Level DATE
Syntax DATA expression{,expression,...}  
Category BASIC
Type Statement
Description queues responses for use by subsequent input requests initiated from "chain", "enter", "execute", or "input" statements. The data is taken from the queue in the order in which it was added.

Multiple "data" statements are permitted. This is preferable to queueing all the data in one long statement.

Each expression becomes the response to one input request from succeeding processes. The "data" statement must be processed prior to an input request.

Note: Wherever "execute" is valid in these examples, "chain" or  "TCL" may also be used. Text within an expression that is passed to UP must be enclosed in quotes; control characters must be outside the quotes. Text may be enclosed in single quotes and the expression enclosed in double quotes; or, the quotes may be used as shown in the examples here.
Options
See Also ENTER EXECUTE CHAIN
Example data 1,2,3
input a
input b
input c
print (a + b) * c

This prints the number "9".

data '(customer,history'
execute 'copy customer *'

This copies all the items from the "customer" file into the "customer,history" file.

The "data" statement can also be used to queue a command which uses an active list:

data 'save-list archive'
execute 'select customer with last.puchase.date < "01/01/80"'
data 'copy customer'
data '(customer,history'
execute 'get-list archive'

data "a'H2O'r'Water'nxf"
execute "update doc example1"
crt "we're back..."

This example illustrates passing data (and commands) to the Update processor. The "a" invokes the Update processor search function, which is passed the string, "H20", the "r" invokes the "replace with" prompt, which is passed the string, "Water". The "n" is the final part of the search/replace, and indicates to replace all occurences. After the search completes, the "xf" command files the item and control returns to the program.
Warnings
Compatibility D3 7.0 AP R83
CRT Index Level DATE