Difference between revisions of "Template:FunctionArgument"
Jump to navigation
Jump to search
imported>DragoonWraith (New page: <includeonly> {{#if: {{{Optional|}}} | '' |}}{{#if: {{{Name|}}} | {{{Name}}} |}}{{#if: {{{Type|}}}|<nowiki>:</nowiki>{{{Type}}}|}}{{#if: {{{Value|}}} | <nowiki>{</nowiki>{{{Value}}}<n...) |
imported>DragoonWraith |
||
Line 1: | Line 1: | ||
<includeonly> {{#if: {{{ | <includeonly> {{#if: {{{optional|}}} | '' |}}{{#if: {{{name|}}} | {{{name}}} |}}{{#if: {{{type|}}}|<nowiki>:</nowiki>{{{type}}}|}}{{#if: {{{value|}}} | <nowiki>{</nowiki>{{{value}}}<nowiki>}</nowiki>}}{{#if: {{{optional|}}} | '' |}}</includeonly><noinclude> | ||
=Template syntax= | =Template syntax= | ||
<pre>{{FunctionArgument | <pre>{{FunctionArgument | ||
| | |name = The name of the function argument. May be omitted, but it only makes sense | ||
to do so when '' | to do so when ''values'' is specified. | ||
| | |type = The type of the function argument (int, float, ref, string, ...) | ||
| | |optional = If specified, the argument is optional | ||
| | |value = If specified, appears after the name and type information. | ||
}} | }} | ||
</pre> | </pre> | ||
Line 14: | Line 14: | ||
<pre>{{FunctionArgument | <pre>{{FunctionArgument | ||
| | |name = foo | ||
| | |type = int | ||
}}</pre> | }}</pre> | ||
{{FunctionArgument | {{FunctionArgument | ||
| | |name = foo | ||
| | |type = int | ||
}} | }} | ||
Line 26: | Line 26: | ||
<pre>{{FunctionArgument | <pre>{{FunctionArgument | ||
| | |value = 0, 1 | ||
}}</pre> | }}</pre> | ||
{{FunctionArgument | {{FunctionArgument | ||
| | |value = 0, 1 | ||
}} | }} | ||
Line 36: | Line 36: | ||
<pre>{{FunctionArgument | <pre>{{FunctionArgument | ||
| | |name = flag | ||
| | |value = 0, 1 | ||
}}</pre> | }}</pre> | ||
{{FunctionArgument | {{FunctionArgument | ||
| | |name = flag | ||
| | |value = 0, 1 | ||
}} | }} | ||
Line 48: | Line 48: | ||
<pre>{{FunctionArgument | <pre>{{FunctionArgument | ||
| | |name = foo | ||
| | |type = int | ||
| | |value = 0, 1; Default = 0 | ||
| | |optional = y | ||
}}</pre> | }}</pre> | ||
{{FunctionArgument | {{FunctionArgument | ||
| | |name = foo | ||
| | |type = int | ||
| | |value = 0, 1; Default = 0 | ||
| | |optional = y | ||
}} | }} | ||
[[Category:Templates|FunctionArgument]] | [[Category:Templates|FunctionArgument]] | ||
[[Category:Structural Templates|FunctionArgument]]</noinclude> | [[Category:Structural Templates|FunctionArgument]]</noinclude> |
Latest revision as of 22:30, 8 August 2010
Template syntax[edit source]
{{FunctionArgument |name = The name of the function argument. May be omitted, but it only makes sense to do so when ''values'' is specified. |type = The type of the function argument (int, float, ref, string, ...) |optional = If specified, the argument is optional |value = If specified, appears after the name and type information. }}
Example 1[edit source]
{{FunctionArgument |name = foo |type = int }}
foo:int
Example 2[edit source]
{{FunctionArgument |value = 0, 1 }}
{0, 1}
Example 3[edit source]
{{FunctionArgument |name = flag |value = 0, 1 }}
flag{0, 1}
Example 4[edit source]
{{FunctionArgument |name = foo |type = int |value = 0, 1; Default = 0 |optional = y }}
foo:int{0, 1; Default = 0}