Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing a table of strings by their values
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00169821
Message ID:
00169869
Views:
18
>I have a dilemna:
>I have a table of 10 character values
>example:
>0000000001
>0000000002
>0000000003
>0000000020
>
>I feed these values into a routine which takes
>the ALLTRIM(STR(VAL())) of these values. When I
>sort the resulting values, I get:
>1
>2
>20
>3
>
>I have to feed the routine with chars, so how can
>I index this table of values such that they are in
>numeric order?
>
>Thanks in advance,
>Jim Smith

Jim,
I would have thought you could simply index on the field as it is.
INDEX on charfield TAG charfield
Numerics will sort properly whether they're left padded with blanks or with '0's.

BTW, Always bad to use TRIM functions in index expressions unless they are padded out to a fixed width again.
Previous
Reply
Map
View

Click here to load this message in the networking platform