Difference between revisions of "Help:Function syntax"

22 bytes added ,  01:21, 5 January 2012
m
moved Function syntax to Help:Function syntax: it's a help page, belongs in the Help namespace.
imported>DragoonWraith
imported>DragoonWraith
m (moved Function syntax to Help:Function syntax: it's a help page, belongs in the Help namespace.)
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
=== Return Value ===
=== Return Value ===


The first part of this format details what the function returns; this value may be stored in an appropriate [[:Category:Variables|variable]] or used as a condition in an <tt>if</tt> statement or similar. If the function does not return any value, <tt>(void)</tt> is used; otherwise, the return value is split into two halves, separated by a colon (<tt>:</tt>). The first half is what the value signifies (often a game statistic, sometimes other things), while the second half is the type of the value:
The first part of this format details what the function returns; this value may be stored in an appropriate [[:Category:Variables|variable]] or used as a condition in an <tt>if</tt> statement or similar. If the function does not return any value, <tt>(nothing)</tt> or <tt>(void)</tt> is used; otherwise, the return value is split into two halves, separated by a colon (<tt>:</tt>). The first half is what the value signifies (often a game statistic, sometimes other things), while the second half is the type of the value:
* <tt>short</tt> for integers.
* <tt>short</tt> for integers.
* <tt>float</tt> for numbers that may include decimals.
* <tt>float</tt> for numbers that may include decimals.