company logo

Do while condition is true

The command allows running a command or a sequence of commands in a BEGIN / DO - END block as long as the condition passed in expression is true. In contrast to FA , the function does not implicitly change the selection for the collection. Instead of a single command one may pass a sequence of commands enclosed in a begin/do-end block. The complete WHILE statement including command or BEGIN / DO has to be defined on a single line.

Parameters:

  • expression - The OSI expression defines the condition to be checked before running the command(s). The expression must be a valid OSI expression. When the expression contains special characters it must be put into quotes or apostrophes.
  • command - The command to be executed when the condition ist true . For processing a block of statements one may use CALL for running a pre-defined procedure or a BEGIN / DO - END block.
  • -Dn - re-direction to other data source.
  • -Cn - re-direction to other collection in the hierarchy or in the data source referenced by -Dn.
  • -In - limit number of iterations to n \n");


Syntax:

  while expression command -Dn -Cn -In

Examples:

  while "++age < 20" p age // print age as long as age < 20

  while next begin         // Print name for all persons with age > 20

    if 'age > 29' p name

  end