Continue

From Wiki
Revision as of 09:58, 18 August 2005 by 80.222.152.154 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Continue

Flow Control

Synopsis

continue

Description

With continue, you can continue to last line of any loop ( while and for ), so that it can start looping again. Ofcourse loop conditions must be valid in order to continue loop, otherwise it just jumps out from loop.

Example

gosub testrandom 
sub testrandom 
{ 
  for %cnt 1 10 
  { 
    if #random % 10 <> 5 
      continue 
    display ok Five has been found! 
    return 
  } 
  display ok Nothing could be found! 
  return 
} 
display ok HALT! 
halt

When random is something else than 5, the if sentence is true and therefor continue gets executed. It jumps over display and return commands and continues for loop if its not over yet ( if %cnt is NOT 10 .

See Also

break while for

Main_Page Documentation Flow Control