Difference between revisions of "Template:FunctionArgument"

From the Oblivion ConstructionSet Wiki
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>&nbsp;{{#if: {{{Optional|}}} | '' |}}{{#if: {{{Name|}}} | {{{Name}}} |}}{{#if: {{{Type|}}}|<nowiki>:</nowiki>{{{Type}}}|}}{{#if: {{{Value|}}} | <nowiki>{</nowiki>{{{Value}}}<nowiki>}</nowiki>}}{{#if: {{{Optional|}}} | '' |}}</includeonly><noinclude>
<includeonly>&nbsp;{{#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
|name = The name of the function argument. May be omitted, but it only makes sense
         to do so when ''Values'' is specified.
         to do so when ''values'' is specified.
|Type = The type of the function argument (int, float, ref, string, ...)
|type = The type of the function argument (int, float, ref, string, ...)
|Optional = If specified, the argument is optional
|optional = If specified, the argument is optional
|Value = If specified, appears after the name and type information.
|value = If specified, appears after the name and type information.
}}
}}
</pre>
</pre>
Line 14: Line 14:


<pre>{{FunctionArgument
<pre>{{FunctionArgument
|Name = foo
|name = foo
|Type = int
|type = int
}}</pre>
}}</pre>


{{FunctionArgument
{{FunctionArgument
|Name = foo
|name = foo
|Type = int
|type = int
}}
}}


Line 26: Line 26:


<pre>{{FunctionArgument
<pre>{{FunctionArgument
|Value = 0, 1
|value = 0, 1
}}</pre>
}}</pre>


{{FunctionArgument
{{FunctionArgument
|Value = 0, 1
|value = 0, 1
}}
}}


Line 36: Line 36:


<pre>{{FunctionArgument
<pre>{{FunctionArgument
|Name = flag
|name = flag
|Value = 0, 1
|value = 0, 1
}}</pre>
}}</pre>


{{FunctionArgument
{{FunctionArgument
|Name = flag
|name = flag
|Value = 0, 1
|value = 0, 1
}}
}}


Line 48: Line 48:


<pre>{{FunctionArgument
<pre>{{FunctionArgument
|Name = foo
|name = foo
|Type = int
|type = int
|Value = 0, 1; Default = 0
|value = 0, 1; Default = 0
|Optional = y
|optional = y
}}</pre>
}}</pre>


{{FunctionArgument
{{FunctionArgument
|Name = foo
|name = foo
|Type = int
|type = int
|Value = 0, 1; Default = 0
|value = 0, 1; Default = 0
|Optional = y
|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}