Template:Eval

From TrainzOnline
Jump to: navigation, search

{{{{{subst|}}}#expr:{{{1}}}}}

Normal evaluation:

  • {{eval|3/4}} gives {{#if:{{#ifexpr:3/4}}|[expression "3/4" is wrong]|{{#expr:3/4}}}}.
  • {{eval|3*4}} gives {{#if:{{#ifexpr:3*4}}|[expression "3*4" is wrong]|{{#expr:3*4}}}}.
  • {{eval|3+4}} gives {{#if:{{#ifexpr:3+4}}|[expression "3+4" is wrong]|{{#expr:3+4}}}}.
  • {{eval|3-4}} gives {{#if:{{#ifexpr:3-4}}|[expression "3-4" is wrong]|{{#expr:3-4}}}}.
  • {{eval|3 mod 4}} gives {{#if:{{#ifexpr:3 mod 4}}|[expression "3 mod 4" is wrong]|{{#expr:3 mod 4}}}}.

Error handling:

Nested error message:

  • {{eval|1+{{eval|3/0}}}} gives {{#if:{{#ifexpr:1+{{#if:{{#ifexpr:3/0}}|[expression "3/0" is wrong]|{{#expr:3/0}}}}}}|[expression "1+{{#if:{{#ifexpr:3/0}}|[expression "3/0" is wrong]|{{#expr:3/0}}}}" is wrong]|{{#expr:1+{{#if:{{#ifexpr:3/0}}|[expression "3/0" is wrong]|{{#expr:3/0}}}}}}}}.
This page has it's origination in the Wikimedia Foundation's development website Meta-wiki or has been exported and is now part of the newer Mediawiki software resources website for assisting new wikis with startup organization and has been copied according to the terms of the (CC-BY-SA-3.0), the GFDL standard GNU pulic license or the source file(s) is/are in the public domain.
Personal tools