Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with index in VFP9.0
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973359
Message ID:
00973369
Views:
26
>The following index in VFP9.0 beta worked fine when doing an insert into the table:
>
>ALLTRIM(STR(add_type))+DTOC(startd8)+ALLTRIM(STR(fk_patients))
>
> ...
>
>Can anyone give me a hint as to why the above index is giving me trouble?

Not sure whether this is the reason for your error, but variable-length index expressions are not supported. VFP pads them (see the "Considerations for Creating Index Expressions" topic in VFP 9 help, where you will find, among other things, "Visual FoxPro does not support variable length index keys. If you attempt to build an index with a key that varies in length, the key is padded with spaces.")

My point being, since your index will be padded to fixed-lengh anyway, you may be able to correct the problem by removing the ALLTRIM() function calls or by using TRANSFORM() or PAD() instead of STR(). Barring a definitive answer on why you get the error using your expression, perhaps a different expression may "just work."

Kelly
Previous
Reply
Map
View

Click here to load this message in the networking platform