The exitloop command can be used to immediately exit from a loop. If this command is called from nested loops, the innermost loop is exited.The syntax is
exitloop;
An example is
loop 100 begin ftpconnect "ftp.ftpsite.com", 21, "ftp", "ftp@site.com"; if success eq ftpresult begin exitloop; #exit loop immediately if connected endend