Hi there,
I have a problem on a simple Blitz3D program. I don't think it is a bug on Blitz3D but I cannot understand why I have this strange result.
Here is the program:
And result is:
i1:2
i2:1
What's wrong with this program? In my understanding I instanciate one T2 element on x1 and another one on x2...
Why do I have strangely two elements on x1 and one on x2?
thanks for any help or advice
have a nice day.
I have a problem on a simple Blitz3D program. I don't think it is a bug on Blitz3D but I cannot understand why I have this strange result.
Here is the program:
Type T1 Field val.T2[10] End Type Type T2 Field x% End Type ;create two instances of T1 x1.T1 = New T1 x2.T1 = New T1 ;create one instance of T2 on x1 and one instance of T2 on x2 x1\val[0] = New T2 x2\val[0] = New T2 ;get first pointer of T2 on x1 and x2 pointer1.T2 = x1\val[0] pointer2.T2 = x2\val[0] ;count number of elements i1 = 0 i2 = 0 While(pointer1<>Null) pointer1 = After(pointer1) i1 = i1+1 Wend While(pointer2<>Null) pointer2 = After(pointer2) i2 = i2+1 Wend Print("i1:"+i1) Print("i2:"+i2) WaitKey() End
And result is:
i1:2
i2:1
What's wrong with this program? In my understanding I instanciate one T2 element on x1 and another one on x2...
Why do I have strangely two elements on x1 and one on x2?
thanks for any help or advice
have a nice day.