Difference between revisions of "Template:Param"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>StDoodle
m (Datatype Constants -> Data Types)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<includeonly>{{#if: {{{ag|}}}|<b>{{Lnkstart}}Data Types#Aggregate{{!}}{{{1}}}&nbsp;{{Lnkend}}</b>|<b>{{Lnkstart}}Data Types#{{{1}}}{{!}}{{{1}}}{{Lnkend}}</b>}}&nbsp;{{#if: {{{2|}}}|{{Pspan|{{{2}}}}}&nbsp;}}</includeonly>
 
<noinclude>
 
<noinclude>
This is the template for a parameter; first supplied value is parameter ''type,'' second is parameter ''description.''
+
<h2>Using Param</h2>
 +
<p>This is the template for a parameter; first supplied value is parameter ''type,'' second is parameter ''description.''</p>
 +
<p>Note that the second parameter, ''description'', is optional. (If used, it will be displayed with automatic styling via [[Template:Pspan]].)</p>
 +
<p>To specify that the return dataype is an aggregate, supply an additional argument of "ag=SOMETHING" where SOMETHING can be any string at all.</p>
 +
<h2>Examples</h2>
 +
<pre>{{Param|int|count}}</pre>
 +
Produces: {{Param|int|count}}
 +
<pre>{{Param|string}}</pre>
 +
Produces: {{Param|string}}
 +
<pre>{{Param|int [string]|map|ag=t}}</pre>
 +
Produces: <b>[[Aggregate|int &#91;string&#93;]]&nbsp;</b>{{Pspan|map}}
 
[[Category:Basic Templates]]
 
[[Category:Basic Templates]]
</noinclude><includeonly>&nbsp;'''[[{{{1}}}]]'''&nbsp;{{#if: {{{2|}}}|{{Pspan|{{{2}}}}}&nbsp;}}</includeonly>
+
</noinclude>

Latest revision as of 04:46, 14 July 2010


Using Param

This is the template for a parameter; first supplied value is parameter type, second is parameter description.

Note that the second parameter, description, is optional. (If used, it will be displayed with automatic styling via Template:Pspan.)

To specify that the return dataype is an aggregate, supply an additional argument of "ag=SOMETHING" where SOMETHING can be any string at all.

Examples

{{Param|int|count}}

Produces: int count 

{{Param|string}}

Produces: string 

{{Param|int [string]|map|ag=t}}

Produces: int [string] map