********** * Traditional way ****** IF llResult foo() ELSE foo2() ENDIF ********** * The "Line IF" (LIF..LELSE) way, showing the comparable source code operations atop each other ***** LIF (llResult) foo() LELSE foo2() ********** * Traditional way showing two commands. As many are as needed can be used. ****** IF llResult lnI = 5 doSomething(lnI) ELSE WAIT WINDOW "Sorry, Charlie!" ENDIF ********** * The LIF..LELSE way, showing the comparable source code operations atop each other ***** LIF (llResult) lnI = 5 .&&. doSomething(lnI) LELSE WAIT WINDOW "Sorry, Charlie!"-----
********** * Traditional model to test if a source code line should be run: ***** IF llTest someCodeGoesHere() ENDIF ********** * Using the predicate model, surround the logical test with brackets as the first item on the line: ***** [llTest] .??. someCodeGoesHere() && Only executed if llTest is true ********** * Extending the traditional model to include several commands in predicates ***** IF llTest someOtherCommandGoesHere() andSomeSecondCommand() andSomeThirdCommand() ENDIF ********** * With the predicate, it can extend to multiple commands thusly: ***** [llTest] .??. someOtherCommandGoesHere() .??. andSomeSecondCommand() .??. andSomeThirdCommand() ********** * To test each line individually, such that llTest may change after each line is processed: ***** IF llTest someOtherCommandGoesHere(@llTest) ENDIF IF llTest andSomeSecondCommand(@llTest) ENDIF IF llTest andSomeThirdCommand(@llTest) ENDIF ********** * With predicates, the test is re-issued each line: ***** [llTest] .??. someOtherCommandGoesHere() [llTest] .??. andSomeSecondCommand() [llTest] .??. andSomeThirdCommand()