data statement

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.

Syntax

data exp{,exp,...}

Description

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 can also be used. Text within an expression that is passed to the Update processor must be enclosed in quotation marks; control characters must be outside the quotation marks. Text can be enclosed in single quotation marks and the expression enclosed in double quotation marks; or, the quotation marks can be used as shown in the examples below.

Example(s)

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.