Help! How to evaluate a math string expression into a number

J

JM

Hi,

I have an string with a math function as:

str = "exp(5)+sqr(4)"

How to convert that string into its numeric value???

I have tried:
dbl = val (str)
and
dbl = CDbl(str)
but does not works.

HELP!!
Thanks,

Jaime
 
M

Marshall Barton

JM said:
I have an string with a math function as:

str = "exp(5)+sqr(4)"

How to convert that string into its numeric value???

I have tried:
dbl = val (str)
and
dbl = CDbl(str)
but does not works.

Try dbl = Eval(str)
 

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

Top