Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a compound index with a descending portion
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01053896
Message ID:
01053948
Vues:
25
>>I have an application that needs a compound index built. The fields are all string fields, but the user would like the second field to be in descending order. Is there a good way to do this in VFP?
>>
>>TIA
>
>How long is this field and what kind of information is in it? Are they only ASCII chars from A to Z? If so you may try
>str = 'ABC'
>NewStr = CHR(155-ASC(SUBSTR(upper(str),1,1)))+CHR(155-ASC(SUBSTR(upper(str),2,1)))+CHR(155-ASC(SUBSTR(upper(str),3,1)))
>
>but this looks like a very complicated solution. I'm sure there is more elegant using bitshift operations...

Yeah that would work if the field is small in size, but it will get a little cumbersome if the field grows in size.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform