# Editing Help:ParserFunctions

 Current revision Your text Line 17: Line 17: | * || Multiplication || {{#expr: 30 * 0 }} = 0 | * || Multiplication || {{#expr: 30 * 0 }} = 0 |- |- - | / OR div|| Division || {{#expr: -30 / 30 }} = -1
{{#expr: -30 div 30 }} = -1 + | / OR '''div'''|| Division || {{#expr: -30 / 30 }} = -1
{{#expr: -30 div 30 }} = -1 |- |- | + || Addition || {{#expr: -30 + 30 }} = 0 | + || Addition || {{#expr: -30 + 30 }} = 0 Line 60: Line 60: *'''{{#ifeq: 7 | +000007.0 | Seven = Seven | Seven is not equal to Seven }}''' shows up as '''{{#ifeq: 7 | +000007.0 | Seven = Seven | Seven is not equal to Seven }}''' *'''{{#ifeq: 7 | +000007.0 | Seven = Seven | Seven is not equal to Seven }}''' shows up as '''{{#ifeq: 7 | +000007.0 | Seven = Seven | Seven is not equal to Seven }}''' - In this above example, notice that {{#ifeq:}} can treat numbers as well as strings. + In this above example, notice that #ifeq can treat numbers as well as strings. {{#ifeq:}} is case-sensitive: {{#ifeq:}} is case-sensitive: Line 83: Line 83: Some examples: Some examples: - *'''{{#ifexpr: 7 + 8 = 15 | yes | no }}''' returns '''{{#ifexpr: 7 + 8 = 15 | yes | no }}'''. + *'''{{#ifexpr: 30 / 40 = 120 | yes | no }}''' returns '''{{#ifexpr: 30 / 40 = 120 | yes | no }}'''. - *'''{{#ifexpr: 7 + 8 = 78 | yes | no }}''' returns '''{{#ifexpr: 7 + 8 = 78 | yes | no }}'''. + *'''{{#ifexpr: {{PAGENAME}} = ParserFunctions |  This is a help page | No}}''' returns '''{{#ifexpr: {{PAGENAME}} = ParserFunctions |  This is a help page | No}}''' because "ParserFunctions" (the text returned by {{PAGENAME}}) is a string, not a number. - *'''{{#ifexpr: {{PAGENAME}} = ParserFunctions |  This is a help page | No}}''' returns the error '''{{#ifexpr: {{PAGENAME}} = ParserFunctions |  This is a help page | No}}''' because "ParserFunctions" (the text returned by {{PAGENAME}}) is a string, not a number. + ==#switch:== ==#switch:== Line 113: Line 112: }} }} and do not have equal signs, and if matches either of them, the text corresponding to will be returned. and do not have equal signs, and if matches either of them, the text corresponding to will be returned. - - Example: -
'''{{#switch: {{[[#.23rand:|#rand:]] 1|10}}
- |1
- |2
- |3
- |4
- |5= This number is 1-5
- |6= This number is 6
- |7= This number is not 8
- |8= This number is 1 more than 7
- |9
- |10= This is either 9 or 10
- }}''' - - turns out as '''{{#switch: {{#rand:1|5}} - |1 - |2 - |3 - |4 - |5= This number is 1-5 - |6= This number is 6 - |7= This number is not 8 - |8= This number is 1 more than 7 - |9 - |10= This is either 9 or 10 - }}'''. ==#time:== ==#time:==

Your changes will be visible immediately. If you would like to test or practice editing, please do so in the sandbox. You are encouraged to create, expand, and improve upon articles; however, bad edits to articles are watched for and will be quickly removed.

Image Code:
Cancel | Editing help (opens in new window)
You are required to enter a code from an image in order to perform certain operations. This image is designed to protect the site from vandalism. If the images are too obscured to read, just give it your best shot and a new image will be shown next time. If you are visually impaired or limited to text-based browsing, you can contact the site administrator and something can be arranged. The code is not case-sensitive.

The Homestar Runner Wiki is neither owned by nor affiliated with homestarrunner.com. Much of the material presented here is copyrighted by The Brothers Chaps and/or Harmless Junk, Inc. For more information, see the legal stuff page on the official Homestar Runner website. The proprietor of this site asserts that publication of such material on the wiki qualifies as fair use under United States copyright law.

Material on this site that is not copyrighted by The Brothers Chaps (e.g. opinions and mindless chatter) is licensed to the various authors, where indicated, and is released under a Creative Commons Deed, which simply ensures that none of this information may legally be used for commercial purposes.