Difference between revisions of "Help:Function syntax"

1,102 bytes added ,  18:25, 31 August 2011
no edit summary
imported>DragoonWraith
(why didn't we create this page YEARS ago?)
 
imported>DragoonWraith
Line 39: Line 39:


If the argument is ''italicized'', then it is optional: you may omit it if you like. Note that in order to use a given optional argument, you must ''also'' use all of the preceding arguments, as well. You cannot "skip" optional arguments, you can only stop and omit all following arguments, or continue and give each argument in the described order.
If the argument is ''italicized'', then it is optional: you may omit it if you like. Note that in order to use a given optional argument, you must ''also'' use all of the preceding arguments, as well. You cannot "skip" optional arguments, you can only stop and omit all following arguments, or continue and give each argument in the described order.
== Summary ==
This section describes what the function does, in some cases in great detail. At the very least, a function should describe exactly what each of the function's arguments do, what you can expect the return value to be in various situations, and any side-effects that running the function may cause (such as changing in-game statistics, moving objects, etc.).
== Example ==
The next part of a function's description may be an example, a small snippet of code showing the function being used in a real or at least realistic setting, rather than the pseudo-code of the syntax description. This example can range from the quite complex to being completely absent, depending on the complexity of using the function in question. A few functions actually have entire, separate tutorials dedicated to the nuances of their use!
== Notes ==
This section lists details, warnings, and caveats to using the function. These are often '''very important''', so make sure you read them!
== See Also ==
This section lists similar functions which may be relevant to someone using the given function.


[[Category:Scripting]]
[[Category:Scripting]]