The data statement 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.
data exp{,exp,...}
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.
This prints the number 9.
data 1,2,3 input a input b input c print (a + b) * c
This copies all the items from the customer file into the customer,history file.
data ’(customer,history’ execute ’copy customer *’
The data statement can also be used to queue a command that uses an active list:
data ’save-list archive’ execute ’select customer with last.puchase.date < "03/01/02"’ 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 in 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 occurrences. After the search completes, the Update xf command files the item and control returns to the program.