Thread:Project:Support desk/Declaring variables?

Transcluded from Help talk:Extension:ParserFunctions (--Theaitetos 21:11, 25 February 2011 (UTC)):

Is there a possibility to declare variables with the Parser Functions (or maybe an extension)? An example:
 * if  is "foo",   should be red and   50
 * if  is "bar",   should be green and   100
 * at the end of the code, there is one code for all cases, like this:

At the moment, I have to write a code like this: I hope you understand what I want to say.--Harmageddon 13:41, 20 February 2011 (UTC)