Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROBLEM: Optimized LOOKUP can get different values
Message
 
 
À
09/09/2003 09:25:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00827451
Message ID:
00827455
Vues:
22
It works properly if you don't use binary data in the character field.
CLEAR
CREATE CURSOR mcur ( F1 C(5) NOT null)
INSERT INTO mcur VALUES ('AB!')
INSERT INTO mcur VALUES ('AB')
INSERT INTO mcur VALUES ('A B')
SET EXACT ON
sExp='AB'
? 'WITH SCAN',LOOKUP(F1,m.sExp,F1)
INDEX ON F1 TAG TAGERR
* with index, lookup is optimized, and uses SET EXACT OFF rule
? 'WITH SEEK',LOOKUP(F1,m.sExp,F1)
>Hi,
>
>LOOKUP is one of the best functions of VFP language.
>With this, you can control a Cursor like a Array.
>
>But:
>
>CLEAR
>CREATE CURSOR mcur ( F1 C(5) NOT null)
>INSERT INTO mcur VALUES ('AB'+CHR(0))
>INSERT INTO mcur VALUES ('AB')
>INSERT INTO mcur VALUES ('A B')
>SET EXACT ON
>sExp='AB'
>? 'WITH SCAN',LOOKUP(F1,m.sExp,F1)
>INDEX ON F1 TAG TAGERR
>* with index, lookup is optimized, and uses SET EXACT OFF rule
>? 'WITH SEEK',LOOKUP(F1,m.sExp,F1)
>
>
>This occur in VFP6/7/8.
>
>Fabio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform