Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting strings with integers..
Message
From
12/01/2007 04:18:12
 
 
To
11/01/2007 19:16:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01184851
Message ID:
01184924
Views:
16
Hi,

>I have records HMD1, HMD2, HMD3... HMD10.. if I do a set order to this field, foxpro lists the records as HMD1, HMD10, HMD2, HMD3..
>
>How can I arrange correctly?

As others have stated it's probably best to change the format at entry. But you *could* use an index. Dragan's example would work:
INDEX ON left(yourkey,2)+transform(val(subs(yourkey,3)), "@L 999") TAG xxx
* except it should be :
INDEX ON left(yourkey,3)+transform(val(subs(yourkey,4)), "@L 999") TAG xxx
You'd still need to enforce the 'three-character followed by up to three digit' rule though.
Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform