Return: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
Tovrleaf (talk | contribs)
No edit summary
 
Tovrleaf (talk | contribs)
added author
Line 22: Line 22:
* [[:Category:Identifiers|Identifiers]]
* [[:Category:Identifiers|Identifiers]]
* [[:Category:Custom Identifiers|Custom Identifiers]]
* [[:Category:Custom Identifiers|Custom Identifiers]]
{{Author|Tovrleaf}}


[[Category:Aliases]]
[[Category:Aliases]]

Revision as of 17:20, 31 August 2005

The Return command

/return [value]

The /return command halts a currently executing script and allows the calling routine to continue processing.

You can also optionally specify a return value which will be stored in the $result identifier. The $result can then be used in the calling routine.

Value is optional. If identifiers doesn't return any existing value, by default is't returned $null.

var %c = 1
while (%c <= 10) {
  echo -a %c
  if (%c == 5) { return }
  inc %c
}

Returns values from 1 to 5.

See Also

Contributed by Tovrleaf