[Gambas-user] Struct declaration scope and array of Struct

Benoît Minisini gambas at ...1...
Sun Jan 27 09:32:31 CET 2013


Le 26/01/2013 00:35, Tobias Boege a écrit :
> Hi,
>
> two separate questions about Structs in Gambas:
>
> 1. Even if I declare a *Public* Struct, all other classes in which I try to
>     use this Struct give me an error about an unknown identifier. In what
>     regard is the Struct 'global'?
>
> 2. The docs state that we could only create embedded arrays of structures
>     but the usual Dim a As New MyStruct[] syntax works perfectly and gives a
>     normal dynamic array with Add() method, etc.. Except one thing I noticed:
>     the objects one added dynamically to the array must apparently be freed
>     by oneself or the interpreter will warn about non-freed allocations.
>     There is DestroyHunk() function in the Project/FPatch.class file in the
>     IDE source code which is the product of this observation. Is this alright
>     and should we trust the documentation to not try to create non-embedded
>     arrays from structures?
>
> I hope these are not too obvious errors of mine...
>
> Regards,
> Tobi
>

Second point: the bug has been fixed in revision #5519.

Regards,

-- 
Benoît Minisini




More information about the User mailing list