Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calculate from a string like
Message
 
 
To
All
General information
Forum:
Visual Basic
Category:
Other
Title:
How to calculate from a string like
Miscellaneous
Thread ID:
00588695
Message ID:
00588695
Views:
56
My database contains a table of formulas that the users can insert into and edit. Being in a database field, they are stored as strings. How do I get VB to calculate the formula, once I read the formula string in from the database? My formulas are very complicated but using the example 'x + y', how do I get VB to calculate the value and give me the result? If I read the string into a variable like Calculation (ex. Calculation = rsDBcalc("Formula")), can I do something like Execute(Calculation) which would return the value of x + y ?

For a more complicated situation, if the database Formula field = 'IF a > b THEN a - b ELSE b - a END IF', how can I do that?

Much thanks for your time.
John
Next
Reply
Map
View

Click here to load this message in the networking platform