Module:Pn/doc: Difference between revisions
From Kenshi Wiki
More actions
Created page with "The module returns one value from its list of unnamed parameters. The named parameter {{para|idx}} is the index of the parameter that is to be returned. Negative indices count backward from the end of the list. A wrapper template may be used to simplify usage. For accessing both named and unnamed parameters, see {{mfl|params|value_of}}. == Examples == * <code><nowiki>{{#invoke:Pn |getVal | idx=1}}</nowiki></code> → {{#invoke:Pn |getVal | idx=1}} * <code><nowiki>{..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{doc sub}} | |||
The module returns one value from its list of unnamed parameters. | The module returns one value from its list of unnamed parameters. | ||
Line 26: | Line 27: | ||
== See also == | == See also == | ||
* {{mfl|params|value_of}} | * {{mfl|params|value_of}} | ||
<includeonly> | |||
[[Category:Modules]] | |||
</includeonly> | |||
<noinclude> | |||
[[Category:Module documentation pages]] | |||
</noinclude> |
Revision as of 03:36, 2 March 2025
This is a documentation subpage for Module:Pn. It may contain usage information, categories and other content that is not part of the original module page. |
The module returns one value from its list of unnamed parameters.
The named parameter |idx=
is the index of the parameter that is to be returned.
Negative indices count backward from the end of the list.
A wrapper template may be used to simplify usage.
For accessing both named and unnamed parameters, see {{#invoke:params|value_of}}.
Examples
{{#invoke:Pn |getVal | idx=1}}
→{{#invoke:Pn |getVal | idx= | a | b | c | d | e | f }}
→ a{{#invoke:Pn |getVal | idx=0 | a | b | c | d | e | f }}
→{{#invoke:Pn |getVal | idx=1 | a | b | c | d | e | f }}
→ a{{#invoke:Pn |getVal | idx=2 | a | b | c | d | e | f }}
→ b{{#invoke:Pn |getVal | idx=-1 | a | b | c | d | e | f }}
→ f{{#invoke:Pn |getVal | idx=99 | a | b | c | d | e | f }}
→
Using a wrapper template, {{P-1}}:
{{p-1 | a | b | c | d | e | f }}
→ f{{wdib|ps=1|P8011|qid=Q84055514}}
→ Template:Wdib{{wdib|ps=1|P8011|qid=Q84055514|list=p-1}}
→ Template:Wdib