LOOP/ENDLOOP
From Zenitel Wiki
Revision as of 06:39, 11 March 2010 by Egil (talk) (New page: The '''LOOP''' and '''ENDLOOP''' statements are used in the Event Handler. The LOOP - ENDLOOP statements can not be nested. When the script execution reaches ENDLOOP, the script jump...)
The LOOP and ENDLOOP statements are used in the Event Handler. The LOOP - ENDLOOP statements can not be nested. When the script execution reaches ENDLOOP, the script jumps back to the previous LOOP statement.
IF/ENDIF along with STOP or BREAK must be used to exit from the loop.
Useless example:
tmp 0 "0" LOOP $put 8 "loop %tmp(0) \n" tmp 0 "%op(%tmp(0),+,1)" IF %op(%tmp(0),=,5) BREAK ENDIF ENDLOOP $put 8 "end loop %tmp(0) \n"