FileMaker If Evaluation
Monday 31st March, 2014
An interesting question came up at work this week. Does FileMaker use lazy evaluation for its control structure conditions or not?
In other words, does TEST
get evaluated in the following statement?
If( False and TEST ; 1 ; 0 )
The quick way to settle the question was to use a global variable assignment - i.e. make TEST
set a global variable using a Let
.
If( False and Let( $$test = "Eager!" ; True ) ; 1 ; 0 )
Evaluate this in the the Data Viewer, and you shouldn’t see the global variable $$test
appearing. For the doubting Thomasinas out there,
If( True and Let( $$test2 = "Test Completed!" ; True ) ; 1 ; 0 )
can also be evaluated, to prove that $test
would have been evaluated if the first condition had been True
rather than False
. QED.