Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting a grid column with negative numbers
Message
De
25/04/2001 11:45:39
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499559
Message ID:
00499631
Vues:
20
>>In my grid class I allow users to sort on up to 3 columns by clicking in the headers. I convert all the fields to characters in order to string them together. For example, the code might look something like:
>>INDEX ON CharField1+STR(NumField2) TAG temp
>>The problem is that if the numeric field contains negative numbers, they don't sort properly by value. How can I get the numbers to sort correctly and yet index on multiple fields?
>>
>>Thanks,
>>Elyse
>

>Maybe you can add a sign flag to the string with iif(x<0,'A','B') or something like that. Then negative values are lower then positive ones.

This puts the negative numbers first, but the higher negative numbers are listed first.
Elyse Pomerantz
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform