ExitLoop ( _exitValue ; _loopLevel )
Exits loop when $i = exitValue
Average rating: 4.4 (33 votes) Log in to vote
Arend van Asselt - Show more from this author
Easy to Work
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
It can be used for a single loop or nested loops. It provides a unique $i value for every nested loop so you can use $i as a parameter in all your expressions in the running script.
By exit $i will be made empty so if you have a loop further on in the script you don't have to reset $i.
This example collects the ID's of a found recordset and shows $i three times in every main loop.
Exit Loop If [ ExitLoop ( get ( FoundCount ) ; 1 ) ]
Set Variable [ $list ; $list & GetNthRecord ( Evaluate(Get(LayoutTableName)&"::id") ; $i ) & ]
Exit Loop If [ ExitLoop ( 3 ; 2 )
Show Dialog [ “Hi I’m number “ & $i ]
Mar 22, 2015
|These are good instructions for someone who wants to create a loop within a FileMaker Script. (However, just to be clear, the statements here will not work inside of a FileMaker Custom Function.)|
Mar 22, 2015
Exit loop is the Custom Function and yes it will work properly!
The goal is that you can use $i as a counter several times in a script without setting $i to 0 for the next loop.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.