Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Was there an Urban Myth regarding ASORT()
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Was there an Urban Myth regarding ASORT()
Divers
Thread ID:
01170165
Message ID:
01170165
Vues:
54
I remember someone telling me that you could not sort on the column values of 2 dimensional arrays.

Has anyone else heard that myth? Here is a sample:
dime aa[5,3]
aa[1,3]=5
aa[2,3]=4
aa[3,3]=3
aa[4,3]=2
aa[5,3]=1
disp memo like aa
*!*	AA                Pub       A   
*!*	   (    1,    1)            L   .F.
*!*	   (    1,    2)            L   .F.
*!*	   (    1,    3)            N   5 
*!*	   (    2,    1)            L   .F.
*!*	   (    2,    2)            L   .F.
*!*	   (    2,    3)            N   4 
*!*	   (    3,    1)            L   .F.
*!*	   (    3,    2)            L   .F.
*!*	   (    3,    3)            N   3 
*!*	   (    4,    1)            L   .F.
*!*	   (    4,    2)            L   .F.
*!*	   (    4,    3)            N   2 
*!*	   (    5,    1)            L   .F.
*!*	   (    5,    2)            L   .F.
*!*	   (    5,    3)            N   1 
asort(aa,aelement(aa,1,3),alen(aa,1)) && Sort on the value of column 3
*!*	AA                Pub       A   
*!*	   (    1,    1)            L   .F.
*!*	   (    1,    2)            L   .F.
*!*	   (    1,    3)            N   1 
*!*	   (    2,    1)            L   .F.
*!*	   (    2,    2)            L   .F.
*!*	   (    2,    3)            N   2 
*!*	   (    3,    1)            L   .F.
*!*	   (    3,    2)            L   .F.
*!*	   (    3,    3)            N   3 
*!*	   (    4,    1)            L   .F.
*!*	   (    4,    2)            L   .F.
*!*	   (    4,    3)            N   4 
*!*	   (    5,    1)            L   .F.
*!*	   (    5,    2)            L   .F.
*!*	   (    5,    3)            N   5 
I dunno - maybe he was pulling my leg. Maybe I'll shave my head and the Discovery Channel will give me a call. Holywood - la - la - la - la - la - Hollyword - swimming stars - tennis pools.
Imagination is more important than knowledge
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform