Wrong ellement in array pointer
Posted: Sat Jan 02, 2010 8:38 pm
I have a strange problem with an array pointer returned from a procedure. I think this is a bug but I'm not sure.
The b(0)\a element is not correct returned from the procedure until you uncomment the "Debug..." line
PB version 4.40 and Win Vista 32bit.
The b(0)\a element is not correct returned from the procedure until you uncomment the "Debug..." line

PB version 4.40 and Win Vista 32bit.
Code: Select all
Structure struc
a.s
b.l
EndStructure
Procedure.i proc()
Dim b.struc(2)
b(0)\a = "ZZZZZZZZ" ;not the correct value
b(0)\b = 4
b(1)\a = "AAAAAAAA"
b(1)\b = 2
b(2)\a = "BBBBBBBB"
b(2)\b = 3
;Debug "OK -> " + b(0)\a ;Uncomment this line and the element is correct returned.
ProcedureReturn @b.struc()
EndProcedure
Dim test.struc(2)
*ptr.i = proc()
test() = *ptr
For iCount = 0 To 2
Debug test(iCount)\a + " -> " + Str(test(iCount)\b)
Next