_iterator; _exitCondition )
_iterator The name of the iterator variable (e.g.
_exitCondition The exit loop condition (e.g $i > 3 )
While Loop Iterator
Exit Loop If [ While ( "i" ; $i + 1 >= 3 ) ]
Show Custom Dialog [ Message: $i; Buttons: “OK”, “Cancel” ]
Show Custom Dialog [ Title: "After the loop"; Message: $i; Buttons: “OK”, “Cancel” ]
This will result in showing 4 times the custom dialog box, three times inside the loop (showing 1-2-3), once outside the loop (showing empty dialogbox).
While ( "i" ; $i + 1 >= 3 )
Will increment $i untill $i >= 3, it will than return 1 and destroy $i
/* While ( _iterator ; _exitCondition )
by Andries Heylen, BH&A
v.1.0 - Sep 10, 2010
- use this function in Exit Loop If  script step
- function will create the iterator variable $ and increments it with 1
- when the exit condition is met the iterator variable is destroyed
PITFALL: when using the iterator as exit condition (for example $i > 3); you should send $i + 1 > 3. This is because the iterator is incremented only in the custom function, and you will still send the old value of the iterator when you use it in the exit condition.
Evaluate ( "
$" & _iterator & " = $" & _iterator & " + 1
Case ( " & _exitCondition & " ; 1 & Let ( $" & _iterator & " = \"\" ; \"\" ) )
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/269
Prototype: While( _iterator; _exitCondition )
Function Author: Andries Heylen (http://www.fmfunctions.com/mid/57)
Last updated: 13 September 2010