in reply to nested variable resolution

mpettis,
A mathematical expression evaluator is the problem I tackled in Breaking The Rules II. It probably is overkill for your problem but is worth a look.

Cheers - L~R