Casting Question - I think!! Help please

  • Thread starter Thread starter Alex Pierson
  • Start date Start date
A

Alex Pierson

I have a string called jkl which currently is "3 * 4 + xyz"
I also have an integer: xyz = 5

How do get an integer that equals 17 (3 times 4 plus 5.)

In other, more specifically:

dim jkl as string = "3 * 4 + xyz"
dim xyz as integer = 5

dim answer as integer = ????????????????????????

Thanks much in advance.
 
Dim jkl As String


Dim xyz As Integer = 5
Dim ans As Integer
ans = CInt(12 + xyz)
 
I saw a mathematical expression parser over at CodeProject the other day
that could handle this and a lot more...
 

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