CN) Details concerning the DESL
while command.The DESL "while" function is a special function which serves to logically determine whether a block of DESL commands will be repetitively executed or not. It is a "conditional" command which is a part of a more complete while/ endw 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.
There is a default limit of 100 while loop executions. The user, however, can increase this default number via the whilelimit command.
The (conditional) arguments associated with the "while" 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. Up to 10 conditions, separated by conjunctions, can be specified.
If the conditions following the "while", considered altogether, accounting for ALL conjunctions and processing from left to right, are TRUE then any commands immediately following the line containing the "while" statement, up to and including the command immediately preceding the "endw" or the end of input, whichever is encountered first, will be processed. Execution of these commands will be repeated until the resultant state of the condition(s) is FALSE. At that time, the DESL commands beginning on the line immediately following the "endw" will be executed.
A "while" block cannot be nested within another "while" or "do" block. This includes the situation which could arise when a macro, itself containing one or more "while"/"do" blocks, is referenced from within a "while" 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.
Macros can be called from within a "while/endw" block of DESL input and, conversely, a macro can contain one or more "while/endw" blocks.
An example of a "while/endw" structure which could be contained in an alternate input file or macro is the following :
reg set *N1 = run reg set *V1 = 1 while exists file *N2 print files *N2 names alpha beta cl cd go reg set *V1 = *V1 + 1 reg set *N2 = *N1 sfx *V1 endw
(See the register command for an explanation of the meaning of the register names *N1, *N2, ... , *N20 and *V1, *V2, ... , *V20.)
There are two fundamental types of condition syntaxes which can be used :
(1) while cond1 ( and/or cond2 ... and/or cond10 )where "cond1", etc. represent "conditions".
(2) while (not) exist(s) file(s) fn1 fn2 ... fni
where "fn1", etc. represent file names
The first type of "while" statement evaluates the True/False state of each condition, logically links them, from LEFT to RIGHT, via the expressed conjunction ("and" or "or") and determines an overall True/False state. For this type of "while" statement up to ten (10) "conditions" can be referenced.
The second type of "while" statement involves checking to see if one or more files either are ALL in existence or are ALL NOT in existence. The resulting True/False state is set accordingly.
Then, for EITHER type of "while" statement, based on this resulting state, the following block of commands are processed or skipped.
The structure of a "condition", used in the first type "while" statement, (1) above, can be either of the following :
Name type expression :
. *N#/str =/eq/ne *N#/str
or
Value type expression :
*V#/## =/eq/ne/ge /gt/>/le/lt/< *V#/##
where *N# and *V# represent the CONTENTS of register number #, "str" represents ANY string other than *N# or *V#, "##" represents ANY value, and "=", "eq", "ne", ... ,"<" are logical comparators with implicit meaning and the slashes divide expression, one of which is required.
A condition involves EITHER name-type OR value-type arguments but NOT a mixture of both.
A "while" command can, however, contain one or more of EACH type of condition. If the "str" character string is one of several strings recognized by DESL as having SPECIAL meaning, then an equivalent new string is substituted for that special string. The special strings defined thus far are the following, accompanied by their possible new (substitution) string(s) and meaning :
| special string | possible new string(s) | meaning |
|---|---|---|
| os | on, off | current overstore state |
| echo | on, off | current echo state |
DESL Manager at ViGYAN, Inc.
30 Research Drive
Hampton, VA 23666
Voice: (757) 865-1400
Toll Free: (800) 288-3998
FAX: (757) 865-8177