#### Archived

This topic is now archived and is closed to further replies.

# VB question

This topic is 5966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hi Assuming that I have string with a value of "10+(5*4)/2^2", is there a function to evaluate that string ?? dim var as integer dim string1 as string string1 = "10+(5*4)/2^2" var = evaluate(string1) then var must equal 15 . what is the "evaluate" function in VB ? thnx n advance,and sorry for my bad English http://abdulla-a2.port5.com

##### Share on other sites
quote:
Original post by beginner_directx
hi

Assuming that I have string with a value of "10+(5*4)/2^2", is there a function to evaluate that string ??
dim var as integer
dim string1 as string
string1 = "10+(5*4)/2^2"
var = evaluate(string1)

then var must equal 15 .
what is the "evaluate" function in VB ?

http://abdulla-a2.port5.com

Don''t quote me on this but I think you can use a function called CallByName to do what you ask. You''ll have to look into the syntax though.

##### Share on other sites
quote:
Original post by Anonymous Poster
[quote]Original post by beginner_directx
hi

Assuming that I have string with a value of "10+(5*4)/2^2", is there a function to evaluate that string ??
dim var as integer
dim string1 as string
string1 = "10+(5*4)/2^2"
var = evaluate(string1)

then var must equal 15 .
what is the "evaluate" function in VB ?

http://abdulla-a2.port5.com

Don''t quote me on this but I think you can use a function called CallByName to do what you ask. You''ll have to look into the syntax though.

Sorry it turns out I was mistaken. You can only use CallByName to call a procedure.

##### Share on other sites
Write your own. There might be some library which will do it, but it isn''t too hard to write, and your code should be faster. It isn''t that hard either.

Trying is the first step towards failure.

##### Share on other sites
thnx both

ragonastick, can you give me the key for accomplishing that ?
I have just started learning VB, and I want to make a good project for school.

http://abdulla-a2.port5.com

##### Share on other sites
I would be grateful if someone could refer some tutorials on that matter.

http://abdulla-a2.port5.com

##### Share on other sites
Is it too hard ? or too simple to answer ?

http://abdulla-a2.port5.com

##### Share on other sites
it's Ok, I found it.
but now the problem is with Sin, Cos, Tan
It needs little work, but not hard to do.
anyway, thanx all

http://abdulla-a2.port5.com

[edited by - beginner_directx on March 21, 2002 12:21:01 AM]

##### Share on other sites
Hey, can you tell use the articles or what ever you found on it. I also just started learning VB and was wondering the exact same thing for making a calculator program.

Possibility

##### Share on other sites
http://www.a1vbcode.com/vbtip.asp?ID=3

http://abdulla-a2.port5.com

1. 1
2. 2
Rutin
22
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002277
×