Repeating of Commands |
heading of conditional repetition
condition test of conditional repetition
commands of conditional repetition
The repeating of commands serves a repeated execution of a command group. The first type of repetition is the conditional repetition. In the repetition condition test the logic term quoted there is tested before each pass of the repetition cycle. If the term is fulfilled, the cycle commands will be executed. In the opposite case the program keeps on running, carrying out further commands following the cycle. This means that if the condition is not satisfied, the commands may not be carried out even a single time.
heading of an iterative repetition
repetition count
commands of an iterative repetition
The second repetition type is repetition with specified run number (iterative repetition). In this type a numeric term in the repetition count specifies the number saying how many times the commands should be carried out. The value of the term specifying the repetition count is rounded up to the nearest integer number and transferred to the absolute value. This means that for the term value ranging between -0.5 < n < 0.5 the cycle commands will not be carried out even a single time.
repetition interrupt (break executing)
The repetition interrupt command serves to finish the repetition prematurely. It is a command, which can be entered anywhere among the commands of the conditional repetition or the iterative repetition. During the execution of this command the highest running cycle is interrupted. If there is no running super-ordinate cycle in the function, the command execution is concluded like the command for concluding the function (function termination). No flag of the repetition interrupt will be transferred out of the function.
Examples of using:
Full Html Context Help of The Peter - Gemtree Software & Children Programming