3.a Recommendations for Jumping out of Loops

We make the following recommendations about loops:

  • use IN loops in preference to WHILE loops;

  • wherever possible set the “Error on Unknown” flag to YES

  • where rules do have return arguments, use the delayed BREAK technique to jump out of a rule;

  • where rules do not have return arguments, write the code in the simplest way possible; this may involve an outer loop if the “Error on Unknown” flag is set; otherwise encase the rule in a “jacket” which OR TRUEs the predicate so that other rules can call the jacket and be certain that the predicate will resolve TRUE;

  • do not use an opening bracket before an IN or a WHILE statement: it creates a spurious impression that you can contain the loop within the brackets. You can’t.

    Back                                Next