>I'm trying to think of a meta-way of doing this, storing code in the 
>database so I don't hardcode anything in the app.  Storing the code in a 
>TEXT (memo) file and then doing something like EXECSCRIPT or something 
>similar.

What you're suggesting is fine, you just need to remember that it has to be 
consistent, variable name-wise.  And that the calculation MUST be a string.  
Though I'd probably just use macro substitution.

I just ran the following in interactive VFP 9:

Cost = 100
tax = 14
overhead = 6
jones_total = "(Cost * (Tax/100)) + Overhead"
? &jones_total

or replace the last line with:

total_calc = "(Cost * (Tax/100)) + Overhead"
jones_total = &total_calc


Ran it again in a program file, still executed just fine.


Joel

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/555618980.1683742.1447797546083.javamail.zim...@comcast.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to