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--