Thread:Project:Support desk/Declaring variables?/reply (2)


 * If you do not have access to the VariablesExtension, you can make use of the switch functions ability to have "fall through" values:


 * Here cases 2, 3 and 4 all return ; cases 6 and 7 both return , e.g. set results like this:


 * If you expect certain values for your parameters you have to write them all down anyway. This way you have to write down all combined parameters, which might be a lot. The other option is to use a second template inside the first one, and have your values as parameters in the implemented template call, e.g. if the second template is called, then write  as follows:


 * Case 1 gives a purple text, case 2, 3 and 4 all red texts, and so forth. That way you can split the colors and width depending on the value of param. If, for example, you expect certain param patterns like "big red" or "little blue", then start the template with an, and similar for the other colors. Then have the second template Rainbow-2 make that test on the expected size-values of the  parameter, like  . --Theaitetos 21:12, 25 February 2011 (UTC)