Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with my code?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00831182
Message ID:
00831477
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform