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 7: | Line 7: | ||
UDFs may optionally return a single value of any type, using the [[SetFunctionValue]] command within them. They may optionally accept up to 15 arguments of any type, which are defined within curly braces: | UDFs may optionally return a single value of any type, using the [[SetFunctionValue]] command within them. They may optionally accept up to 15 arguments of any type, which are defined within curly braces: | ||
<pre> | <pre> | ||
int arg1 ; * args are optional | int arg1 ; * args are optional | ||
ref arg2 | ref arg2 | ||
Line 14: | Line 12: | ||
Begin Function { arg1, arg2, arg3... } | Begin Function { arg1, arg2, arg3... } | ||
; * | ; * body | ||
End | End | ||
</pre> | </pre> | ||
and called in a similar way to regular functions: | and called in a similar way to regular functions: | ||
<pre> | <pre> | ||
Call SomeUDF arg1, arg2, arg3... | |||
let SomeVariable := Call SomeOtherUDF arg1 | |||
let SomeVariable := | |||
if eval (call SomeSuitableUDF) | if eval (call SomeSuitableUDF) | ||
Line 133: | Line 126: | ||
*[[Eval]] | *[[Eval]] | ||
*[[Let]] | *[[Let]] | ||
==External Links== | ==External Links== | ||
*[http://www.loverslab.com/topic/26802-tutorial-nvse4-part-2-user-defined-functions-udfs/ Tutorial on User Defined Functions in NVSE 4] | *[http://www.loverslab.com/topic/26802-tutorial-nvse4-part-2-user-defined-functions-udfs/ Tutorial on User Defined Functions in NVSE 4] | ||
[[Category:NVSE]] | [[Category:NVSE]] | ||
[[Category:User Defined Functions]] | [[Category:User Defined Functions]] |