Return
From UBot Studio
(Difference between revisions)
Line 1: | Line 1: | ||
− | This command is a [[Flow Commands|Flow Command]]. This command exits the current command or function and allows custom functions to return a value. This command is designed to allow the user to re-use code in the form of custom functions where a value is returned. | + | This command is a [[Flow Commands|Flow Command]]. This command exits the current command or function and allows custom functions to return a value. |
− | This command is used within the [[Define|define]] command | + | |
+ | This command is designed to allow the user to re-use code in the form of custom functions where a value is returned. | ||
+ | |||
+ | This command is used within the [[Define|define]] command. | ||
+ | |||
+ | |||
+ | '''Return Value:''' the value that is being returned from the custom functions. | ||
+ | |||
== Example == | == Example == |
Revision as of 15:18, 24 April 2013
This command is a Flow Command. This command exits the current command or function and allows custom functions to return a value.
This command is designed to allow the user to re-use code in the form of custom functions where a value is returned.
This command is used within the define command.
Return Value: the value that is being returned from the custom functions.
Example
define $my test function { set(#test, $eval($add(5, 2)), "Global") return(#test) } type text(<about me textarea>, $my test function(), "Standard")
Running the above script creates a function that calculates 5+2 in the variable "test". The return command sets the entire function to the value of the calculation in the variable. The function is then used to place the result in the specified field.