Editing User Defined Function
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
User defined functions (UDF) are added by NVSE V4. They must be saved as 'object' type scripts that must use the "Function" block type only. Although 'object' type, they must not be attached to any object and are instead called directly by script name from within other scripts, using the [[Call]] command. | User defined functions (UDF) are added by NVSE V4. They must be saved as 'object' type scripts that must use the "Function" block type only. Although 'object' type, they must not be attached to any object and are instead called directly by script name from within other scripts, using the [[Call]] command. | ||
UDFs may optionally return a single value of any type, using the [[SetFunctionValue]] command within them. They may optionally accept | UDFs may optionally return a single value of any type, using the [[SetFunctionValue]] command within them. They may optionally accept one or more arguments of any type, which are defined within curly braces: | ||
<pre> | <pre> | ||
scn SomeUDF | scn SomeUDF | ||
Line 33: | Line 33: | ||
</pre> | </pre> | ||
== | ==Example== | ||
<pre> | <pre> | ||
scn fnShuffle | scn fnShuffle | ||
Line 104: | Line 80: | ||
End | End | ||
</pre> | </pre> | ||
==Notes== | ==Notes== | ||
*UDFs may be used recursively by saving the script once first without the sub call. | *UDFs may be used recursively by saving the script once first without the sub call. | ||
*This article is a simple overview, seek external documentation for further information. | |||
==See Also== | ==See Also== |