« Loops - while » : différence entre les versions
De Semantic MediaWiki - Sandbox
(chg) |
(wiki) |
||
Ligne 15 : | Ligne 15 : | ||
{{Callout | {{Callout | ||
|This example makes use of the "Variables" extension. | |This example makes use of the [[mediawikiwiki:Extension:ParserFunctions|"ParserFunctions" extension]] and the [[mediawikiwiki:Extension:Variables|"Variables" extension]]. | ||
|info | |info | ||
}} | }} | ||
[[Category:Loops examples]] | [[Category:Loops examples]] |
Version du 4 septembre 2018 à 09:42
- Syntax
{{#vardefine: i | 0 }}{{#while: | {{#ifexpr: {{#var: i }} < 5 | true }} | <nowiki /> * {{#var: i }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }} }}
- Result
- 0
- 1
- 2
- 3
- 4
This example makes use of the "ParserFunctions" extension and the "Variables" extension.