Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Browse bug??
Message
De
12/06/2007 15:09:54
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
07/06/2007 14:06:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01231066
Message ID:
01232369
Vues:
15
>>>I can not see what causes your problem, but I have a few advices:
>>>1. Avoid SET FILTER whenever possible, instead you can use "BROWSE FOR yourcondition"
>>
>>BROWSE FOR is equal to SET FILTER. What are you referring to?
>
>Over the years I have had many problems when I used SET FILTER, so I stopped using it whenever I could. One problem was that it is easy to forget to reset it, and you end up with too few records. I don't remember the other problems, but since it's usually easier to add a FOR whatevercondition, I prefer that.
>
>>>2. Don't use GO TOP after SET FILTER, instead use LOCATE which in many cases is extremely much faster
>>
>>That's for sure!

It occurred to me there may be a performance benefit in this as well. It's not much, but...

USE members
LOCAL m.lnA, m.lnX
m.lnA = SECONDS()
FOR m.lnX = 1 TO 10000
SET FILTER TO UPPER(SURNAME)="Z"
SCAN
ENDSCAN
NEXT m.lnX
?SECONDS() - m.lnA

m.lnA = SECONDS()
FOR m.lnX = 1 TO 10000
SCAN FOR UPPER(SURNAME)="Z"
ENDSCAN
NEXT m.lnX
?SECONDS() - m.lnA

Gives me .349 seconds for the first block and .184 seconds for the second. No need for the LOCATE in the first as the SCAN does that.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform