[Gambas-user] Struct declaration scope and array of Struct
Tobias Boege
taboege at ...626...
Sat Jan 26 00:35:59 CET 2013
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
More information about the User
mailing list