Template:choose/documentation

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Documentation for Template:choose. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

This template returns only one among multiple unnamed parameters. It is, technically, a cleaner and stricter variety of {{#switch:}}.

Usage

[edit]

Just fill multiple unnamed (positional) parameters with contents and input a number to the named parameter |choice=. If no number is input, "1" is assumed.

Examples

[edit]
  • {{choose|cat|dog|mouse|choice=2}} returns:

dog

  • {{choose|cat|dog|mouse|choice=3}} returns:

mouse

  • {{choose|apple|pear|watermelon|banana|choice=1}} returns:

apple

  • {{choose|apple|pear|watermelon|banana}} returns:

apple

  • {{choose|apple|pear|watermelon|banana|choice=4}} returns:

banana

See also

[edit]