మూస:Missing param/doc

వికీపీడియా నుండి
Jump to navigation Jump to search


This helper template provides a means of testing if a specified number of parameters are defined. It will test n parameters n is between 1 and 10. It is intended to be used in other templates.

Returns the a number which indicates the first undefined parameter or the empty string if all parameters are defined. n specifies the number of parameters expected.

Usage

{{missing param|n=4|1|2|3|4}}

{{missing param|n=4|1| |3|4}} → 2

{{missing param|n=4|1|2|3| }} → 4

Examples

{{Error
| {{#switch: {{missing param|n=3|1| |3}}
  | 1 = The 1st parameter is missing.
  | 2 = The 2nd parameter is missing.
  | 3 = The 3rd parameter is missing.
  | ... }} }}

The 2nd parameter is missing.

{{#if: {{missing param|n=3|1| |3}}
  | There is a missing parameter.
  | ...
}}

→ There is a missing parameter.

See also