Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting strings with integers..
Message
De
12/01/2007 04:18:12
 
 
À
11/01/2007 19:16:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
Divers
Thread ID:
01184851
Message ID:
01184924
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform