Return

From Wiki
Revision as of 23:48, 13 August 2005 by Snicker7 (Talk | contribs) (Synopsis)

Jump to: navigation, search

return

Flow Control

Synopsis

return [expression]

Description

The return command transfers the execution back to where the sub was called using gosub.

Placing something after return will put that value into the #result system variable.

Example

gosub makeLowerCase #charname
event macro 1 0 my name is #result
halt

;The following sub takes the first parameter
;makes it lowercase, and then returns the
;lowercase version.
sub makeLowerCase
	str lower %1
return #strRes    ; the lowercase version of %1 is now stored in #result and control is returned to the main script.

See Also

sub gosub

Main_Page Documentation

Flow Control