Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting arrays

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anybody know if there is a way to sort a 2 dimensional array of strings. Any information would be very helpful. I know it's possible in java, c++, vb.... but not sure about foxpro.
Thanks
 
HI
If your array is n dimensional..
=ASORT(myArray,x) where x is the element on which you want to sort

The available options are...
ASORT(ArrayName [, nStartElement [, nNumberSorted [, nSortOrder [, nFlags]]])

Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
If you are wanting to sort all the elemts of the 2 dimensional array, you need to do something like:

*... 2 dimension aMyArray
DIMENSION aTemp[ALEN(aMyArray)] &&... 1 dimension aTemp

ACOPY(aMyArray, aTemp)
ASORT(aTemp)
ACOPY(aTemp, aMyArray)

Otherwise, it just sorts the rows.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top