Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing problem
Message
From
23/11/2004 09:59:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/11/2004 00:42:55
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00963720
Message ID:
00963822
Views:
7
For an index, make sure that the index expression results in the same size for all records.

You might use:
index on mill + bank + branch
If you want to eliminate the spaces between the fields, you have to add them again at the end:
index on padr(alltrim(mill) + alltrim(bank) + alltrim(branch), 30)
Or:
index on mill - bank - branch
I think that you get the error message because in the first record processed, all three fields are blank. This results in an index key of length zero.

You are lucky to get the error message. Otherwise, you would simply get unpredictable results. VFP will evaluate the length of the expression for the first record it processes. This may give indexes of diferent sizes, for different data.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform