ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Template:Values"

From ModEnc
Jump to: navigation, search
m (Limitations...)
m (Color Formats and minor wording edits.)
Line 24: Line 24:
 
|listofstrings = {{{separator|Comma}}}-separated list of [[Help:Values#Strings|strings]]. {{#if: {{{2|}}} | (Limited to: {{{2}}})}}
 
|listofstrings = {{{separator|Comma}}}-separated list of [[Help:Values#Strings|strings]]. {{#if: {{{2|}}} | (Limited to: {{{2}}})}}
 
|color
 
|color
|colors = [[Help:Values#Colors|Colors]]
+
|colors = [[Help:Values#Colors|Colors]]: {{#switch: {{lc:{{{2}}}}} |rgb = R,G,B |hsb = H,S,B |#default = R,G,B}} format
 
|clsid
 
|clsid
 
|clsids
 
|clsids
Line 36: Line 36:
 
|special = Values that don't conform to any typical format (see article)
 
|special = Values that don't conform to any typical format (see article)
 
|#default = Warning: Unknown value type selected! Please [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit] this page and fix the [[Template:Values|Values template]].
 
|#default = Warning: Unknown value type selected! Please [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit] this page and fix the [[Template:Values|Values template]].
}}</includeonly><noinclude>This template generates standardized value type descriptions for a number of common types, to be used in the <code>values=</code> parameter of [[Template:Flag]].
+
}}</includeonly>
 +
 
 +
<noinclude>This template generates standardized value type descriptions for a number of common types, to be used in the <code>values=</code> parameter of [[Template:Flag]].
  
 
==Usage==
 
==Usage==
Line 68: Line 70:
 
|<code>strings</code>, <code>string</code>, or <code>str</code>
 
|<code>strings</code>, <code>string</code>, or <code>str</code>
 
|-
 
|-
|{{{separator|Comma}}}-separated list of [[Help:Values#Strings|strings]]
+
|List of [[Help:Values#Strings|strings]]
 
|<code>stringlist</code> or <code>listofstrings</code>
 
|<code>stringlist</code> or <code>listofstrings</code>
 
|-
 
|-
Line 88: Line 90:
 
yields "{{Values|stringlist|[[Animations]]}}".
 
yields "{{Values|stringlist|[[Animations]]}}".
  
In cause of <code>stringlist</code>, an additional argument <code>separator</code> can be provided. It defaults to "Comma" and describes the separator between the list entries. For example:  
+
The list separator defaults to "Comma", but can also be explicitly stated in the following way:
 
<pre>{{Values|stringlist|[[Sound filenames]]|separator=Whitespace}}</pre>
 
<pre>{{Values|stringlist|[[Sound filenames]]|separator=Whitespace}}</pre>
yields "{{Values|stringlist|[[Sound filenames]]|separator=Whitespace}}".
+
This yields "{{Values|stringlist|[[Sound filenames]]|separator=Whitespace}}".
 
</noinclude>
 
</noinclude>

Revision as of 21:30, 21 April 2008


This template generates standardized value type descriptions for a number of common types, to be used in the values= parameter of Template:Flag.

Usage

{{Values|VALUE TYPE}}


Valid Value Type Codes
Value Type Codes
Signed integers signed integers, signed integer, integers, integer, or int
Unsigned integers unsigned integers or unsigned integer
Floating point values floats or float
Unsigned Bytes unsigned bytes, unsigned byte, bytes, or byte
Signed Bytes signed bytes or signed byte
Boolean values booleans, boolean, or bool
Strings strings, string, or str
List of strings stringlist or listofstrings
Colors colors or color
CLSIDs clsids, clsid, locomotors, or locomotor
Percentages percentages, percentage, percents, percent, or %
Non conforming values special

In the case of strings and stringlist, a second parameter can be added to note what the strings are limited to. For example:

{{Values|stringlist|[[Animations]]}}

yields "Comma-separated list of strings. (Limited to: Animations)

".

The list separator defaults to "Comma", but can also be explicitly stated in the following way:

{{Values|stringlist|[[Sound filenames]]|separator=Whitespace}}

This yields "Whitespace-separated list of strings. (Limited to: Sound filenames)

".