Forum:Template Functions, Variables, etc help

Hi, I've been researching http://www.mediawiki.org/wiki/Help:Magic_words and http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions and http://help.wikia.com/wiki/Help:Preloaded_templates amongst many other searches and I've picked up lots of useful functions to use, particularly in creating a Preloaded New Page Template. I've also been studying up on Excel and extracting relevant data from cells to operate with. Some things I haven't found an answer to yet that I need to make my template work:
 * 1) Is there any way to have a Infobox-type-template popup window prompt the user for what format data it expects to be enterred? eg: I want a user to input a Cost Type of Dollars or Piastres and have the Infobox display $ or €, but how do I say "enter P or 2 for Piastres and D or 1 for Dollars"?? So I have made this code to detect carious ways of the user enterring the type:  But even then it will fail if they enter "Piastre" or "money2" or anything else... Shouldn't there be a way to prompt the user without making it part of the  ?
 * 2) I know in Excel how to extract the first character of a cell, but how can I truncate a wiki variable input? In the above example, say a user enters "Piastre", I want to be able to: so I only have to #switch: the first character.
 * 3) The above example has #switch: insert a $ by default if there is no match, but in general for variables, say would insert 0.2 if no user input is enterred, but the fields in the popup are all blank. Can't we make the popup show the default values, so the user (not just the coder) knows which fields are pre-filled by defaults so they know they don't have to fill them in unless they need changing.
 * 4) Depending on whether the output of  is € or $ I want to do different calculations on other variables (and this is just one example of variables and formulas I want to do in my page-creation-template, so rather than having dozens of dozens of lines nesting the same if/switch statments is there a way to input data into a variable without doing through a user popup box? eg:

and

So then later: I can do operations and output to cells:

And then 5 subsequent lines with "Level 1" and the above * 1.7 etc, and other columns with similar formulas. I'd much rather lines like that rather than nesting everything like:

in about 50 cells for the first simplified page...

Any suggestions?

About how to truncate a word, you can use the StringFunctions. I'm not able to help you on the other matters, sorry.

Thanks so much, 1 down, 3 to go! So to ignore anything past the first character and ouput a currency symbol I've now got this code:

Still, going to be annoying to have to use a 3-line-long expression in 50+ cells if there is no method of defining a variable outside of a popup box.

Oooh - I just stumbled across this myself: mw:Extension:Variables and other interesting links from the page: Help:Parser functions