VB question

Started by
8 comments, last by beginner_directx 22 years, 1 month ago
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
http://uae-arts.host.sk
Advertisement
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.

quote:Original post by Anonymous Poster
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.

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.
Trying is the first step towards failure.
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
http://uae-arts.host.sk
I would be grateful if someone could refer some tutorials on that matter.

http://abdulla-a2.port5.com
http://uae-arts.host.sk
Is it too hard ? or too simple to answer ?

http://abdulla-a2.port5.com
http://uae-arts.host.sk
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]
http://uae-arts.host.sk
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
http://www.a1vbcode.com/vbtip.asp?ID=3

http://abdulla-a2.port5.com
http://uae-arts.host.sk

This topic is closed to new replies.

Advertisement