Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting a grid column with negative numbers
Message
 
To
25/04/2001 10:13:33
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499559
Message ID:
00499885
Views:
23
>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

Have you tried use INDEX ON CharField1+STR(ABS(NumField2)) TAG temp to give you an unsigned number for the index?
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
Previous
Reply
Map
View

Click here to load this message in the networking platform