Template:Evaldemo/doc

< Template:Evaldemo
Revision as of 11:34, 6 June 2011 by Cottrells (talk | contribs) (Created page with 'Examples: #{{Tlx|Evaldemo|CURRENTDAY|s=is}} displays #:{{Evaldemo|CURRENTDAY|s=is}} #{{Tlx|Evaldemo|#expr:2*3}} displays #:{{Evaldemo|#expr:2*3}} #<nowiki>{{subst:evaldem…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Examples:

  1. {{Evaldemo{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ CURRENTDAY }} is 31
  2. {{Evaldemo{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ #expr:2*3 }} gives 6
  3. {{subst:evaldemo|subst=subst:|#expr:2*3}} gives:
    {{ subst:#expr:2*3}} gives 6
  4. {{Evaldemo{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ #expr:2+2=5 }} gives 0
  5. {{Evaldemo{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ #expr:(2+2=4) }} = 1
  6. {{Evaldemo{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ urlencode:! }} = %21
  7. {{Evaldemo{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives
    {{ uc:abc }} gives ABC
  8. {{subst:Evaldemo|uc:Upper Case|subst=subst:}} substitutes
    {{ subst:uc:Upper Case}} gives UPPER CASE
    See Help:Substitution for several caveats wrt subst=subst:.

As always the expression (first parameter) cannot directly contain "|", "=", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "=" as shown above.

For simple nested expressions use Template:Evaldemo/2 (edit talk links history):

  1. {{evaldemo/2{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ #expr: 4*{{ #expr:not 0}} >3 }} yields 1
  2. {{evaldemo/2{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} displays
    {{ urlencode:{{ DIRMARK}}}} gives %E2%80%8E