Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SRP_Array (SortArray)
I have an array, I populate it COL:ROW and Set_Property(@window:'.TBL_DEPOSITS','ARRAY',DepositArray)
I am trying to use SRP_Array(SortArray...) to sort based on Column #1.
I am not having any luck with SRP_Array and I am sure its based on not knowing how to use it.
I followed the following instructions from the SRP wiki:
// Sort an OI EditTable on column 2 in ARRAY format
TableArray = Get_Property(@Window:".EDT_TEST", "ARRAY")
NewArray = SRP_Array("SortRows", TableArray, "AL2")
Set_Property(@Window:".EDT_TEST", "ARRAY", NewArray)
But it did not produce the results I expected.
I have created two separate arrays, one that lists all deposits and one that lists all posted interest both have an associated data field (AVM). I join the arrays together and populate the data into the edit-table on the form as an 'ARRAY', but since I joined two separate arrays, I need it to sort based on Col#1 which is the date field, and need it to sort on the OCONV of the date.
Attached is my sample code and attached is a screenshot of the result. Any help would be appreciated, TIA
I am trying to use SRP_Array(SortArray...) to sort based on Column #1.
I am not having any luck with SRP_Array and I am sure its based on not knowing how to use it.
I followed the following instructions from the SRP wiki:
// Sort an OI EditTable on column 2 in ARRAY format
TableArray = Get_Property(@Window:".EDT_TEST", "ARRAY")
NewArray = SRP_Array("SortRows", TableArray, "AL2")
Set_Property(@Window:".EDT_TEST", "ARRAY", NewArray)
But it did not produce the results I expected.
I have created two separate arrays, one that lists all deposits and one that lists all posted interest both have an associated data field (AVM). I join the arrays together and populate the data into the edit-table on the form as an 'ARRAY', but since I joined two separate arrays, I need it to sort based on Col#1 which is the date field, and need it to sort on the OCONV of the date.
Attached is my sample code and attached is a screenshot of the result. Any help would be appreciated, TIA
Comments
As it has '/' in the masking of the date i.e. 04/16/2001. And try AR2 as an 'ARRAY' or 'LIST'? Thanks,
You will need to:
for k = 1 to TotDeposits DepositArray<1,k> = InvestmentRec<LV$DEPOSIT_DATE,k> . . for k = 1 to TotInterest InterestArray<1,k> = InvestmentRec<LV$INTEREST_DATE,k> . . for k = 1 to 5 DepositArray<k> = DepositArray<k>:VM$:InterestArray<k> . . . SortedArray = SRP_Array('SortRows',DepositArray,'AR1') DepositArray<1>=oconv(DepositArray<1>,'D4/')
I've got it working. Thanks again.