DESL


DESL Home | Website Outline | Commands | Examples | Download | Contacts

( AI) Details concerning the DESL do command.


(See example(s) of the use of the do command.)
[Jump to the list of available options.]
General description of the do command :

The DESL "do" function is a special function which serves to repetitively execute a block of DESL commands. It is a "list-oriented" command which is a part of a more complete "do/enddo" structure which can be included in any DESL command stream which is NOT being entered in the purely interactive mode; ie, via entry of each command at the keyboard.

The block of commands contained within the "do/enddo" section of DESL input are executed repetitively, setting the appropriate User and/or Value registers equal to the "next" item included in one or more "lists", previously defined, until the shortest list being currently used is exhausted. At that time the looping action stops and control is allowed to go to the next DESL command which follows the ending "enddo". During each trip through the block of DESL commands the registers which were set to the "next" list items are available for use by other DESL commands.

All of the referenced "lists" of strings/values should exist at the time the "do" command is encountered. See the list command for a discussion of the construction of a "list" of strings or values.

A "do" block CANNOT be nested within another "do" or "while" block. This includes the situation which could arise when a macro, itself containing one or more "do" blocks, is referenced from within a "do" block, since the macro's contents is effectively put inline in the input stream at the point of its mention, whether or not it is actually called.

The general syntax of the arguments which can follow the "do" command is the following :



do ( reg_name list_name )1 ( ... )2 ... ( ... )20


where, "reg_name" is a valid User Name or Value register name and "list_name" is the name of a previously-defin "list" of items.

The items which MUST follow the "do" string are composed of pairs of strings; each pair contains

  1. a User Name or Value register name and
  2. the name of a currently defined "list"
The number of execution trips through the block of DESL commands which are contained in the "do/enddo" section of input is equal to the number of items in the SHORTEST referenced list.

During any given trip through the DESL commands contained in the "do/enddo" block the loop trip number is the sequence number, within the respective list, of the item which will be moved into the respective register for that loop trip. Up to 20 lists can be referenced in a "do/enddo" block : 10 User Value and 10 User Name registers.

The pairs of arguments associated with the "do" command must begin on the command line and can be continued to one or more subsequent lines via the inclusion of the blank-delimited ampersand symbol (&) as the last item on the line.

Macros can be called from within a "do/enddo" block of DESL input and, conversely, a macro can contain one or more "do/enddo" blocks.

An example of a "do/enddo" structure which could be contained in an alternate input file or macro is the following :



.
.
.
list runlist 1 2 6 to 9
list filelist 3 at tr89 tr34 tr9 tr88
.
.
.
do *V13 lstnam1 *N12 lstnam2
print
files *N12 names alpha beta cl cd
cset 1 run eq *V13 go
enddo
In the example above the two lists "runlist" and "filelist" are referenced by the "do" command. Each of these lists has previously been defined to contain 6 items. Therefore, the number of trips through this "do" block of DESL input will be 6.

The two User registers, "*V13" and "*N12" are, for each trip through the block of DESL input, each set to the item whose sequence number in the respective list is equal to the "do" trip number.

(See the register command for an explanation of the meaning of the User register names *N11 --> *N99 and *V11 --> *V99.)

[Top][Bottom][Option list]


DESL Home | Website Outline | Commands | Examples | Download | Contacts




ViGYAN, Inc.


DESL Manager at ViGYAN, Inc.

30 Research Drive
Hampton, VA 23666
Voice: (757) 865-1400
Toll Free: (800) 288-3998
FAX: (757) 865-8177

© 1998 ViGYAN, Inc.