Variables demo
From Notaclue Wiki
| Variables | |
|---|---|
| Documentation | |
| Maintained by WikiTeq? |
No |
| Version | |
This wiki has the Variables extension installed, which adds the ability to store and use variables in the wikitext.
| Code | Output | Explanation |
|---|---|---|
{{#vardefine:foo|something}} |
Set variable foo to the value something
| |
{{#vardefineecho:bar|other}} |
other | Set variable bar to the value other and print that value
|
{{#varexists:foo|yes|no}} |
yes | Check if a variable is defined |
{{#varexists:baz|yes|no}} |
no | |
{{#var:foo}} |
something | Retrieve the value of a variable |
{{#vardefine:foo|changed}} |
Set variable foo to the value changed, replacing previous value
| |
{{#var:foo}} |
changed | Retrieve the value of a variable |