Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Always better to ...?
Message
From
28/02/2000 16:03:06
 
 
To
26/02/2000 20:07:17
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338054
Message ID:
00338674
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform