Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Always better to ...?
Message
De
28/02/2000 16:03:06
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
26/02/2000 20:07:17
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338054
Message ID:
00338674
Vues:
18
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform