Difference between revisions of "Template:FunctionArgument"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>SnakeChomp
(Update examples)
imported>Cipscis
(→‎Example 4: Added default value)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<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=
Line 6: Line 6:
|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)
|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
|Values = If specified, the given set of values is shown instead of the type
|Value = If specified, appears after the name and type information.
}}
}}
</pre>
</pre>
Line 18: Line 18:
}}</pre>
}}</pre>


{{FunctionArgumentTest
{{FunctionArgument
|Name = foo
|Name = foo
|Type = int
|Type = int
Line 26: Line 26:


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


{{FunctionArgumentTest
{{FunctionArgument
|Value = 0, 1
|Value = 0, 1
}}
}}
Line 37: Line 37:
<pre>{{FunctionArgument
<pre>{{FunctionArgument
|Name = flag
|Name = flag
|Values = 0, 1
|Value = 0, 1
}}</pre>
}}</pre>


{{FunctionArgumentTest
{{FunctionArgument
|Name = flag
|Name = flag
|Value = 0, 1
|Value = 0, 1
Line 50: Line 50:
|Name = foo
|Name = foo
|Type = int
|Type = int
|Value = 0, 1; Default = 0
|Optional = y
|Optional = y
}}</pre>
}}</pre>


{{FunctionArgumentTest
{{FunctionArgument
|Name = foo
|Name = foo
|Type = int
|Type = int
|Value = 0, 1; Default = 0
|Optional = y
|Optional = y
}}
}}


</noinclude><includeonly>&nbsp;{{#if: {{{Optional|}}} | '' |}}{{#if: {{{Name|}}} | {{{Name}}} |}}{{#if: {{{Value|}}} | <nowiki>{</nowiki>{{{Value}}}<nowiki>}</nowiki> | <nowiki>:</nowiki>{{{Type}}}}}{{#if: {{{Optional|}}} | '' |}}</includeonly>
</noinclude>

Latest revision as of 01:10, 15 May 2009


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}