[Gambas-user] gb.Args component, FOR EACH...NEXT not working

Bruce Steers bsteers4 at gmail.com
Wed Aug 2 23:28:12 CEST 2023


On Wed, 2 Aug 2023, 22:22 Bruce Steers, <bsteers4 at gmail.com> wrote:

>
>
> On Wed, 2 Aug 2023, 22:11 Demosthenes Koptsis, <demosthenesk at gmail.com>
> wrote:
>
>> i test gb.Args component with the following code
>>
>> ----------------------------------
>>
>> ' Gambas module file
>>
>> Public Sub Main()
>>
>>    Dim sElement As String
>>
>>    For Each sElement In Args
>>      Print sElement
>>    Next
>> End
>> ------------------------------------
>>
>> When i run the Project140.gambas with parameters i get output only for
>> command name
>>
>> ----------- Console -----------
>>
>> ./Project140.gambas -1 -2 -3
>> ./Project140.gambas
>> ----------------------------------
>>
>> the parameters -1 -2 -3 are omitted
>>
>
> The Args.class itself is not enumerable you must use the All property...
>
> For Each sElement In Args.All
>      Print sElement
> Next
>

Oops sorry, the args class IS enumerated 🙄

Ignore me lol 😂
BruceS

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230802/812c0232/attachment.htm>


More information about the User mailing list