Excel type calculation

  • Thread starter Thread starter Paul Remblance
  • Start date Start date
P

Paul Remblance

Is there a 'simple' way to perform a calculation on a textbox entry similar
to Excel. For example: if the user enters =2*3 the validated event changes
it to 6.
 
Paul said:
Is there a 'simple' way to perform a calculation on a textbox entry similar
to Excel. For example: if the user enters =2*3 the validated event changes
it to 6.

In the old days this would have meant lexing the input, building a
parse tree, and walking that to produce a result. These days, we have
the (to my mind extremely elegant) method of using regexes to do all
the work. See for example

<http://www.devx.com/vb2themax/Tip/19438>

or just google for regex expression evaluator.
 
Paul said:
In the old days this would have meant lexing the input, building a
parse tree, and walking that to produce a result. These days, we have
the (to my mind extremely elegant) method of using regexes to do all
the work. See for example

<http://www.devx.com/vb2themax/Tip/19438>

or just google for regex expression evaluator.

Not what I would call 'simple' but it works fine, many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top