Archived

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

beginner_directx

VB question

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 this post


Link to post
Share on other sites
Guest 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 ?

thnx n advance,and sorry for my bad English



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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 ?

thnx n advance,and sorry for my bad English



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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites