
Cantata(Control)             Khoros              Cantata(Control)

     WHILE-LOOP Control Structure

     The WHILE-LOOP structure is used to create a condition con-
     trolled loop.  Where the condition can be an expression
     based on data or on a variable.  The following parameters
     determine its operation.

     Initial Expression
          Expression to be evaluated the first time the loop is
          executed (or after a `RESET').  This may be used to
          initialize a variable to be used by the `Test Expres-
          sion' or may be used independently, as a "counter", for
          example.  (Optional for the WHILE loop.)

     Update Expression
          Expression to be evaluated each subsequent pass through
          the loop.  (Optional for the WHILE loop.)

     Test Expression
          Expression to be evaluated as either TRUE (1) or FALSE
          (0) to determine when looping should terminate.  This
          expression may use values defined by the `Initial'
          and/or `Update Expression(s)' or may be based on values
          extracted from the data.

     See documentation on `VARIABLES subform' for description of
     valid expressions. See the manual page on varviff (1) for
     information on how to extract data values from the flow
     graph.

     EXECUTION

     The first time the glyph is executed (or after a `RESET'),
     the `Initial Expression' is evaluated, then the `Test
     Expression' is evaluated.  If the `Test Expression' is
     evaluated as TRUE, then the appropriate input data is passed
     to the `Loop Output' and the loop is executed.

     To avoid synchronization problems, ALL children of a loop
     glyph are executed BEFORE the loop is re-executed.  When the
     execution path returns to the WHILE-LOOP glyph, the `Update
     Expression' is first evaluated and then the `Test Expres-
     sion', etc.  If the `Test Expression' is evaluated as FALSE,
     then the appropriate input data is passed to the `Exit Out-
     put' and execution passes out of the loop.

     WHILE_LOOP USAGE

     Input   The "upper" input arrow corresponds to the `Initial
             Input' to the loop.  Data on this connection will be
             passed to `Loop Output' when the loop is first exe-
             cuted (or after a RESET).  The `Initial Input' is
             optional, and thus not required in loops for which
             it is not needed.

             The "lower" input arrow corresponds to the `Loop
             Input'.  The glyph which produces the value to be
             passed back through the loop is connected here to
             indicate the feedback to the loop.  If no feedback
             is needed, or the initial input is to be used on
             each pass through the loop, the `Loop Output' should
             be connected back to the WHILE-LOOP here (see Loop
             Examples).

     Output  The "upper" output arrow corresponds to the final
             loop `Exit Output'. If further processing is
             required AFTER the loop, those glyphs are connected
             here.  (The `Exit Output' is optional.)

             The "lower" output arrow corresponds to the `Loop
             Output' path. The first processing glyph in the loop
             sequence is connected here.

             Copyright 1991, University of New Mexico. All rights
             reserved.

Version: 0                 Release: 1                           1

