Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array Sort Challenge...
Message
De
13/05/1999 19:34:04
 
 
À
13/05/1999 12:41:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00218459
Message ID:
00218771
Vues:
19
Have you tried asort() on each of the ordering columns from least significant to most significant?

If this works, benchmark against a cursor.

>Ok Folks...
>
>I need a UDF that will sort and array using multiple columns... simmilar to an ORDER of a select.
>
>My particular array has 3 columns, but, to make it generic, and more challenging, lets allow the ordering to work on an unknown number of rows, and not limit the ordering to a certain number or rows.
>
>For example... if I have an array such as....
>
>
>
>Row    Col1   Col2   Col3
>1       C     900     10
>2       A     901     11
>3       A     902     12
>4       B     903     13
>5       A     904     14
>6       B     905     15
>
>
>
>I want to be able to call my UDF like...
>
>Prototype
>
>AORDER( ARRAY by Reference, ORDER String )
>
>AORDER( @MyArray, '1,2')
>
>And get the following result:
>
>
>Row    Col1   Col2   Col3
>1       A     901     10
>2       A     902     12
>3       A     904     14
>4       B     903     13
>5       B     905     15
>6       C     900     10
>
>
>BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform