Jump to content
  • Advertisement

Archived

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

beginner_directx

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.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
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 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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!