[Gambas-user] Arrays of Structs

Cam Era cybercamera at ...626...
Tue Nov 29 05:11:37 CET 2016


On Tue, Nov 29, 2016 at 3:05 PM, Jussi Lahtinen <jussi.lahtinen at ...626...>
wrote:

> Seems that the arrays remain uninitialized... I'm not sure why.
> Do you really need embedded arrays and structs? They are mainly for
> interacting with libraries written in C, and using Pictures inside of the
> struct kind of contradicts that.
>
> I'm mean that all works if you do it with classes and initialize the arrays
> as:
>
>    '' In MapRoom class
>    Public MapObjects As New MapObject[50]
>
>
>   '' And this where ever you need it
>   Static Private WorldMap As New MapObject[100, 100]
>
>
>
> Jussi
>


Jussi,

firstly, thanks for the response. I probably don't need to be using an
array of Structs - considering how sparsely these will be populated, I can
probably get by with using a multi-dimensional array of strings and then
parsing the strings to obtain complex data from within them.

This was more of an exercise in better understanding how Gambas works. Your
explanation makes sense, so when necessary, I'll use the Class approach
rather than fall-back onto Structs.

Cheers.

-- Cam



More information about the User mailing list