Type
Command component


Purpose
The do keyword is a component of the while command syntax.
When processing reaches a while command, DataEase evaluates the condition that follows the keyword while. If the specified condition is true, DataEase executes all the actions that follow the keyword do until it reaches the corresponding end command. DataEase then reevalutes the original condition. If the condition is still true, DataEase executes the do action series again. If the condition is false, processing passes to the first action following the end command for the while statement.

Syntax
while CONDITION do
ACTION 1 .
[ACTION 2 . ACTION 3 .]
end

Example
define temp "CRUISE TICKET NUM" Number .
assign temp CRUISE TICKET NUM := 0 .
while temp CRUISE TICKET NUM <=1000 do
temp CRUISE TICKET NUM := temp CRUISE TICKET NUM + 1 .
list records
jointext ( "Cruise Boarding Pass No. " ,
temp CRUISE TICKET NUM) .
end

This script tells DataEase: (1) Create (define) a temporary variable called CRUISE TICKET NUM, (2) give (assign) an initial value of 0 to the CRUISE TICKET NUM variable, (3) print a series of labels joining the words Cruise Boarding Pass No. to the number that is the current value of the CRUISE TICKET NUM variable, (4) while printing the labels, increment the variable by one each time a new label is printed, and (5) when the value of the variable exceeds 1000, stop printing labels.
The while command tells DataEase to reevaluate the value of the variable each time it prints a label. As long as that value is less than or equal to 1000, DataEase prints another label. When the value of the variable exceeds 1000, DataEase stops performing the action following the do keyword.