Difference between revisions of "Continue"

From Wiki
Jump to: navigation, search
(See Also: added reference)
Line 1: Line 1:
__NOTOC__
+
{{command header|Flow Control}}
== Continue ==
+
 
'''Flow Control'''
+
{{body|continue|Continue stops execution of code inside of a loop. Control is returned at the point of the next evaluation.}}
=== Synopsis ===
+
[[continue]]
+
=== Description ===
+
Continue stops execution of code inside of a loop. Control is returned at the point of the next evaluation.
+
  
 
==== Example ====
 
==== Example ====
Line 28: Line 24:
 
When random is something other than 5, the if sentence is true and therefore continue is executed. It jumps over the [[display]] and [[return]] commands and continues the [[for]] loop with it's next iteration. In the case that the evaluation is false, execution proceeds to the statement following the loop structure.
 
When random is something other than 5, the if sentence is true and therefore continue is executed. It jumps over the [[display]] and [[return]] commands and continues the [[for]] loop with it's next iteration. In the case that the evaluation is false, execution proceeds to the statement following the loop structure.
  
=== See Also ===
+
{{footer}}
{|
+
| width=200px | [[break]] || width=200px | [[while]] || width=200px | [[for]] || width=200px | [[repeat..until]]
+
|}
+
----
+
{|
+
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px | [[Documentation#Flow_Control|Flow Control]]
+
|}
+

Revision as of 17:20, 26 August 2005


Synopsis

continue

Description

Continue stops execution of code inside of a loop. Control is returned at the point of the next evaluation.

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 other than 5, the if sentence is true and therefore continue is executed. It jumps over the display and return commands and continues the for loop with it's next iteration. In the case that the evaluation is false, execution proceeds to the statement following the loop structure.

See also

Main Page Documentation