[Gambas-user] Bug or intended pointer behavior? (in Gambas3)

Jussi Lahtinen jussi.lahtinen at ...626...
Wed Apr 15 14:49:28 CEST 2009


Hi!

I have code like this;

Dim Points As New POINT[]
Dim pResult As Pointer

  ....some initialization of variable Points....

pResult = Alloc(8, 10)
functionX(pResult)

....

Class POINT:
Public x As Short
Public y As Short


This way code works fine.
But way this fails?

functionX(Points.Data)

It gives Signal 11 (when accessing Points again), and I think it is
because allocation is not done correctly.
If POINT[] would be Object[] instead, it would make more sense...
If I understand correctly, Interpreter should know how to allocate
pointer to POINT[],
just like it will allocate pointer to Integer[] correctly, when using .Data.

Do I need to do this with old Gambas2 way (with Alloc & Read & Write)
or is this bug?


Jussi




More information about the User mailing list