Difference between revisions of "Help:Function syntax"

Jump to navigation Jump to search
22 bytes added ,  16:44, 1 September 2011
→‎Return Value: (nothing) or (void)
imported>DragoonWraith
imported>DragoonWraith
(→‎Return Value: (nothing) or (void))
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.

Navigation menu