Previous Topic: &INKEY

Next Topic: &LUCOLS


&LOOPCTL

Returns the current setting of the automatic loop control counter.

&LOOPCTL is a system variable that is used to determine the value of the system loop control counter current for the executing process. The system default value for &LOOPCTL is 1000, and this value decrements by one for each time a loop is executed. On exit from a loop, the counter returns to the default value. If the counter reaches0, then the process is terminated, on the assumption that it is looping uncontrollably.

Example: &LOOPCTL

&IF &LOOPCTL LT 10 &THEN +
  &GOTO .GIVEUP

Notes:

The &LOOPCTL verb is used to reset the loop control counter. You might need to do this if you expect to loop validly for a significant number of iterations during standard processing.

If your procedure has varying processing to perform, resulting in possible very lengthy iterations, you can check the decrementing value of &LOOPCTL and take action to avoid abnormal termination of the procedure.

More information:

&LOOPCTL