>Locate is code that is cryptic and hard to maintain? That's what's screwed up.
>
>If you'd look at my FPA articles, you'll find that I used a routine to determine whether to use GO TOP or LOCATE depending on the existance of a filter condition. I don't see how knowing when to use locate is any different than knowing when and how to Rushmore optimize. Its a matter of learning and ability.
>
>I don't comment every sql with "please see index expression so and so to understand Rushmore optimization"
If you look at VFP Help, "FOR lExpression" is shown as a required clause of the LOCATE command, although experience has clearly shown it isn't required. A command parser working strictly to the VFP documentation would throw an error on that line.
Besides looking "incomplete", a plain LOCATE command gives no inherent indication of what it actually does. Someone not familiar with how the command actually works might assume that:
- it goes to the current record
- it goes to EOF(), because it clearly can't find something that isn't specified
That meets my definition of cryptic.
As for comments, no-one's holding a gun to your head. Personally, I feel it's impossible to have too many comments in one's code.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up