Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with my code?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00831182
Message ID:
00831477
Vues:
17
It's a bad idea to use ALLTRIM() in indexes. It createas a lot of problems:
1. VFP doesn' support variable lenght index key, so it'll use a current record to determine key lenght which coould cause a key truncation.
2. It ould cause SEEK to find wrong record because 'AB' + 'C' = 'A' + 'BC'
e.t.c

>I often get this kind of problem when concantenating strings as in your
> SEEK l_cocode + l_prcode
> I usually 'ALLTRIM' each part and set the index to be the same. i.e. index is 'alltrim(cocode)+alltrim(prcode)' and then 'seek alltrim(l_cocode)+alltrim(l_prcode'). I know it is a horrible index to have and not to good on large files but it usually resolve the problem of those spare spaces.
>Michael
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform