[Gambas-user] Would an ArrayList datatype be helpful for gambas users?

Gianluigi gradobag at gradobag.it
Sun Sep 10 22:53:01 CEST 2023


Il 10/09/23 21:10, Martin Fischer ha scritto:
>>
>> I don't see the need of that as you can already use an array to do the
>> same thing.
>>
>> Or maybe I missed something?
>>
>
> Benoit,
>
> first I was confused about your reply...
> Then I thought: He really should know...
> Then I fired up gambas to find out if native arrays do already have the
> convenience of my ArrayList...
>
> And yes: you are right. Arrays resize automatically and have a "add to
> tail" method (Add), and, and, and, ...
> The only thing they do not have is the Slice (sublist view) stuff. But
> that is surely not a justification to add another class.
>
> I'm just wondering why I did not find this in the gambas-wiki. Is it
> possible that this is basically undocumented?
>
> Regards
> Martin
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Sorry Martin,

I didn't understand what you mean by 'Slice', something like that?

Public Sub Main()

   Dim aArr As String[] = ["A", "B", "C", "D", "E", "F", "G"]

   For Each s As String In aArr.Copy(3, 3)
     Print s
   Next

End

Regards

Gianluigi



More information about the User mailing list