How, using I4GL, do you evaluate a numerical expression held in a CHAR variable?

How, using I4GL, do you evaluate a numerical expression held in a CHAR variable?

Post by Paul Wheele » Sun, 31 Dec 1899 09:00:00



Does anybody remember the 'EVAL' command in Basic?  It allows you to
compose a
string variable, e.g. A$="((127-82)/42)*27.5" and then assign the value of
the string into
a numeric variable, i.e. A=EVAL(A$).

Currently I am using a SQL query to do this calculation for me and it is
proving inefficient.
I'm sure there is a 'text book answer' for this solution, something along
the lines of calling a function
with a pre-constructed string, and for it to return the evaluated answer
with a level of decimal
precision.

Any ideas would be gratefully appreciated.

Paul Wheeler.

 
 
 

1. How, using I4GL, do you evaluate a numerical expression held in a CHAR variable

Does anybody remember the 'EVAL' command in Basic?  It allows you to
compose a
string variable, e.g. A$="((127-82)/42)*27.5" and then assign the value of
the string into
a numeric variable, i.e. A=EVAL(A$).

Currently I am using a SQL query to do this calculation for me and it is
proving inefficient.
I'm sure there is a 'text box' answer for this solution, something along
the lines of calling a function
with a pre-constructed string, and for it to return the evaluated answer
with a level of decimal
precision.

Any ideas would be gratefully appreciated.

Paul Wheeler.

2. INGRES Help

3. Problem using a local variable to hold a table name

4. Stored Procedures

5. help using variables to hold column names

6. Help: Database

7. defining a variable to hold LONG field using OCI

8. Stored Procedure Stops functioning

9. Using a variable to hold the tablename

10. how to evaluate regular expressions from SQL Server 2000

11. Evaluating expressions

12. function to evaluate expressions (like eval in VB)

13. SS7: Paranthesized expressions not evaluated correctly in computed fields