Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Always better to ...?
Message
De
02/03/2000 14:04:54
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338054
Message ID:
00340753
Vues:
32
George and Larry

Unfortunately, this goes right back to the initial topic. If there are 2 ways to do something (in this case move to the first record in a set), we need a way to know which is the best way (and when to apply it). LOCATE works faster than GO TOP only when a filter is in effect. Your sample code only proved that GO TOP is faster when no filter is in effect. Your comparisons didn't encompass the entire situation.

Now its also true that we should be using views. I wrote another article that proved using Rushmore optimization at all in a remote view scenario is overkill. We really should test and proclaim loudly that SET OPTIMIZE should be OFF where remote views are used.

Al,
Your statement that the help shows LOCATE cannot be used without the FOR clause is right. The help is wrong. George's code proves that. The real issue is that a client will be happier with a snappier program than with a sluggish one. The snappier program will only come from using the snappiest code. Its our duty to make the best fastest prettiest applications we can deliver on time and under budget.

Programming is unfortunately an exercise in cryptography. We are all trying to "translate" user requirements into working code. The problem I'm trying to address here is to find the best way to write some code so we only have to learn the one way.

This thread stuff sure can run off on tangents. All I wanted was an examination of small code blocks to show how to write them most efficiently.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform