When I insert a product I add an array
aadd(aColBtn,{nItem,ncolSer} )
nItem is the number of Item and mColSer is the colum where I show the product
before to show the product I try to search the value of ncolSer on array aColBtn
If Len(aColBtn) >0
nColser:= ascan( aColBtn, {|e| e[1] = nItem})
If nColser=0
ncolSer:=200
Endif
else
ncolSer:=200
endif
the problem is the procedure found the nItem but take the first of the array with same nItem and not that having the max value
then I thinked to make another test
I when save on array aColBtn I must erase all records having the same nItem
adel( aColBtn, {|e|e[1] = nItem},.t.)
and I can save the current value
aadd(aColBtn,{nItem,ncolSer} )
but not run
because adel erase all records why ?