First of all, you cannot really use VBScript for programming of a "real" Web site. It is supported, basically, only by IE, so, who will need such page? To publish your work on a Web site, you really need to write in JavaScript.
You idea to use
eval
is great, but in your next steps you go nowhere. Things are much, much simpler than that: it's enough to use only one
eval
in whole calculator, with much, much better results.
Please see my calculator available in my CodeProject article, complete with detail explanations of all the ideas and techniques:
JavaScript Calculator[
^].
Good luck,
—SA