Asort 101
Posted: Tue Sep 11, 2012 9:43 pm
To All
I have never had to sort an array before .. I have looked at the asort documentation and looked at some posts in this forum .. and the answer seems a bit 'blurry' to me.
I have a simple 4 element array with multiple rows and the last element is the row number assigned to the row when it was added ..
the array table may look like this
2345 200001 x3456 3
5678 200001 x3456 1
4567 200001 x3486 2
I want to be able to sort this array by element 4 .. as you can see from my above 'feeble' attempt I need some basic array sorting help.
Any advice would be appreciated!
Rick Lipkin
I have never had to sort an array before .. I have looked at the asort documentation and looked at some posts in this forum .. and the answer seems a bit 'blurry' to me.
I have a simple 4 element array with multiple rows and the last element is the row number assigned to the row when it was added ..
Code: Select all
nRow := oLbx:KeyNo()+1
aLine := { space(50),nRepairNumber,cInventoryId,nRow }
Aadd( aSerial, aLine )
aSort( aSerial, 4 ) // this does not work
2345 200001 x3456 3
5678 200001 x3456 1
4567 200001 x3486 2
I want to be able to sort this array by element 4 .. as you can see from my above 'feeble' attempt I need some basic array sorting help.
Any advice would be appreciated!
Rick Lipkin