Asort array base two elements and found the last number
Posted: Sun Mar 22, 2020 1:06 am
Dear friends,
I must found the last number (field 1) of this array if the cCode ( field 2) is "01"
Local aData:= { ;
{4,"01","17/03/2020","17/03/2020"} ,;
{7,"02","17/03/2020","18/03/2020"} ,;
{7,"01","17/03/2020","18/03/2020"} ,;
{11,"02","17/03/2020","18/03/2020"} ,;
{8,"01","17/03/2020","18/03/2020"} }
local cCodice:="01"
I try with
ASort( aData ,,, {|x,y| If ( x[2] == cCodice, x[1]< y[1],) } )
How I can make to found the last value for the code "01" ?
it must return me 8
I must found the last number (field 1) of this array if the cCode ( field 2) is "01"
Local aData:= { ;
{4,"01","17/03/2020","17/03/2020"} ,;
{7,"02","17/03/2020","18/03/2020"} ,;
{7,"01","17/03/2020","18/03/2020"} ,;
{11,"02","17/03/2020","18/03/2020"} ,;
{8,"01","17/03/2020","18/03/2020"} }
local cCodice:="01"
I try with
ASort( aData ,,, {|x,y| If ( x[2] == cCodice, x[1]< y[1],) } )
How I can make to found the last value for the code "01" ?
it must return me 8