[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Structure definitions can't be shared between modules?


On 3/29/24 08:14, T Lee Davidson wrote:
On 3/29/24 02:06, Benoît Minisini wrote:
Le 29/03/2024 à 04:01, T Lee Davidson a écrit :
Let's say I have a Main.module and a Minor.module. I have a structure definition in Minor.

If I try to declare a variable in Main using Minor.StructName as it's type, I get a "Unexpected '.'" error. So, structures must be declared Public but yet they're not public. ??

Is it possible to share structure definitions, or do I need to define the structure in both modules?


Structures are there mainly for dealing with shared libraries. This is why they are second-class citizen.

That's what I am dealing with. The module is an interface to an external shared library. Both the interface and the main module need to deal with external types.

Now I'm thinking that I should re-think the overall design of the entire application. If I do retain the Minor module as a library to interface with an external library and define the structure in both modules, at least I know the compiler will inform me if the definitions disagree.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
Structure definitions can't be shared between modules?T Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: Structure definitions can't be shared between modules?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Structure definitions can't be shared between modules?T Lee Davidson <t.lee.davidson@xxxxxxxxx>