Difference between revisions of "Template:FunctionArgument"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>SnakeChomp
(Display type and values at the same time if both are specified)
imported>SnakeChomp
(Move template code to the top. Add Value to example 4.)
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 50: Line 50:
|Name = foo
|Name = foo
|Type = int
|Type = int
|Value = 0,1
|Optional = y
|Optional = y
}}</pre>
}}</pre>
Line 56: Line 57:
|Name = foo
|Name = foo
|Type = int
|Type = int
|Value = 0,1
|Optional = y
|Optional = y
}}
}}


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

Revision as of 19:15, 30 January 2009


Template syntax

{{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
|Values = If specified, appears after the name and type information.
}}

Example 1

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

 foo:int

Example 2

{{FunctionArgument
|Values = 0, 1
}}

 {0, 1}

Example 3

{{FunctionArgument
|Name = flag
|Values = 0, 1
}}

 flag{0, 1}

Example 4

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

 foo:int{0,1}