Core Function Goto Label

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Goto Label; & Label: </pre> === Description === Jump to another section of the script === Remarks === This is not a universal *jump to anyhting you can see* it can only...")
 
(Remarks)
Line 14: Line 14:
  
 
Note - People often avoid using "goto" statements in languages because they tend to be slow and a very poor way of solving a problem yet its here if you want it.
 
Note - People often avoid using "goto" statements in languages because they tend to be slow and a very poor way of solving a problem yet its here if you want it.
 +
 +
If a label cannot be found an exception will occure.
  
 
=== Example ===
 
=== Example ===

Revision as of 13:20, 2 December 2011

Goto Label; & Label:

Description

Jump to another section of the script

Remarks

This is not a universal *jump to anyhting you can see* it can only jump through local scopes and what not.

Think of it as a kind of multilayer break statement.

Note - People often avoid using "goto" statements in languages because they tend to be slow and a very poor way of solving a problem yet its here if you want it.

If a label cannot be found an exception will occure.

Example

goto Begin;
 
Above:
println(  "Hello Above"  );
goto Below;
 
Begin:
println(  "Hello"  );
goto Above;
 
Below:
println(  "Hello Below"  );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox