Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing a table of strings by their values
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00169821
Message ID:
00169869
Vues:
20
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform