The While command allows you to add a “flow of control” command into the script when defining a Variable. While a condition is satisfied, the indented commands in the script following the While command will be repeatedly run.

Using The Dialog

Adding this command will display a dialog for you to use to specify the variable name that will have its value tested and the condition the value must meet in order to keep running the following (indented) commands in the script.

The While command allows you to selectively run commands in the report depending on the value of variable. The report will continue to ‘loop round’ until the condition you specify in this dialog is satisfied.

Is - the logical tests to be used to compare the variable.

Fixed Value - Choose this option to check for a single specific value each time round.

Variable - Choose this option to compare the ‘While’ variable with another variable each time round.

Example use of While

The following example will repeat output of a component name 5 times.

Set Variable "count" to 5
While "Variable: count" is more than "0"
	Component Name
	Decrement Variable "count" by 1

For a working example of where this is used look at the format file “Parts List CSV.rff”. The while loop is used to output a line for each instance of an associated part.

Report Maker | Generate Reports | Fixed Commands | If | List | Position | Value | Variable