Replies To: Calculate using a formula that is stored in a string expression

Re: Calculate using a formula that is stored in a string expression

Posted 04 April 2013 - 12:31 PM

... because they *are* strings. Just a series of characters. *You* need to give them life.. so you build an interpreter. Something that examines each each indexed character, deciphers if they are a variable, value, or operator... then asks the user to fill in the variables, and finally runs everything (values and operators) in proper math order of operations.

Re: Calculate using a formula that is stored in a string expression

Posted 04 April 2013 - 12:36 PM

VB6 doesn't have an eval() function to evaluate an expression. It is possible to do this by referencing VBScript and using its Eval function. Otherwise, you would need to parse the string-expression yourself, converting its various parts to variable-values and function calls.

Re: Calculate using a formula that is stored in a string expression

Posted 05 April 2013 - 09:23 AM

andrewsw, on 04 April 2013 - 12:36 PM, said:

VB6 doesn't have an eval() function to evaluate an expression. It is possible to do this by referencing VBScript and using its Eval function. Otherwise, you would need to parse the string-expression yourself, converting its various parts to variable-values and function calls.