[Gambas-user] Using a Struct

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Jul 22 08:17:56 CEST 2015


Tried to send you an answer, but it was bounced and after 4 days (read 
four days!) it came back to me this morning, so let me try if it is 
functionable again...

Rolf

Am 16.07.2015 17:56, schrieb Tobias Boege:
> On Thu, 16 Jul 2015, Rolf-Werner Eilert wrote:
>> Randall,
>>
>> Thank you for making that clear. Is it possible to make something like
>> an array out of a whole structure? What would this code look like?
>>
> Yes, you can use a Struct just as you use classes. I believe I sent you a
> link yesterday where derived arrays are explained :-) If you have any class
> (or Struct) MyClass in Gambas, you can use the identifier MyClass[] in your
> code and the interpreter will recognise this and create a class -- on the
> fly -- which represents an array of MyClass objects.
>
> So, if you have
>
>    Struct Hund
>      Wuff As String
>    End Struct
>
> you can have an array of Hunde via
>
>    Dim aHunde As New Hund[]
>
> I have also put the embedded array syntax into a new section in the Struct
> declaration wiki page[0]. Do you think it's better now?
>
> Regards,
> Tobi
>
> [0] http://gambaswiki.org/wiki/lang/structdecl
>
> PS: Randall, nice to see you around again :-)
>





More information about the User mailing list