Sort an array

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Sort an array

Jean_Louis_Beraudo


Hello,

How to code a sort to obtain the following result:
Sort by country then name.

Input of the Sort:

    custDB[0] = Customer(101,"Ueli Wahli"         ,"U.S.A." ,500.5,25,yes)
    custDB[1] = Customer(102,"Peter Heuchert"     ,"Germany",400.4,30,yes)
    custDB[2] = Customer(103,"Frederik Haesbrouck","Belgium",350.9,24,no)
    custDB[3] = Customer(104,"Norio Furukawa"     ,"Japan"  ,250.5,39,no)
    custDB[4] = Customer(105,"John Doe"     ,"U.S.A."  ,250.5,39,no)

Output of the Sort

    custDB[0] = Customer(103,"Frederik Haesbrouck","Belgium",350.9,24,no)
    custDB[1] = Customer(102,"Peter Heuchert"     ,"Germany",400.4,30,yes)
    custDB[2] = Customer(104,"Norio Furukawa"     ,"Japan"  ,250.5,39,no)
    custDB[3] = Customer(105,"John Doe"     ,"U.S.A."  ,250.5,39,no)
    custDB[4] = Customer(101,"Ueli Wahli"         ,"U.S.A." ,500.5,25,yes)

Have a nice day

Jean-Louis Beraudo


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>