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