Guy Roussin wrote:
I suppose this is not a bug but a pointer behavior.
I try to create a 2D array and this is what i get :

#!/usr/bin/hbrun

function main()
local aArray:={}

asize(aArray,20)
afill(aArray,{})
aeval(aArray,{|x|asize(x,5)})

aArray[5,2]:="test"
? aArray[4,2] // test !

return (NIL)

Hi,


great - it works as expected! All array is AFILLed using the SAME empty array. Use:

LOCAL aArray := ARRAY(20) // More short and quick, than := {}, ASIZE()
AEVAL(aArray, {|X,Y| aArray[Y] := ARRAY(5)}) // new array for every item


Regards,
Mindaugas
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to