>I want to create a very flexible program to interpret employee key punches (in, out, and perhaps missing) and by using a schedule and a previously defined set of rules, calculate the different rates of pay applicable.
I don't know whether this is good enough for you, but I needed to do something similar once, where the user could insert user-defined calculations.
Basically, you can have a field (in a variable number of records) where the user types in a formula, VFP syntax.
With eval(), you can then evaluate those rules.
For a complete solution, you may want to have special variables, which you replace before you eval(): for instance, the expression row(5) might refer to the calculated value of the fifth row. That is, while you evaluate each row, you place the calculated values in an array.
Evaluating VFP expressions has its problems, too - it is difficult to avoid that the user access publicly available variables or methods, which you had only designed for internal use.
However, evaluating formulae with eval() is very flexible, and relatively easy to program.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)