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

Demosthenes Koptsis demosthenesk at gmail.com
Wed Aug 2 23:32:37 CEST 2023


yes it is enumerable

i tries your example with Args.All and pass arguments as "-3 test" but 
still i get only the command name no parameters no arguments...

------------------

' Gambas module file

Public Sub Main()

   Dim sElement As String

   For Each sElement In Args.All
     Print sElement
   Next
End
-----------------------

---- Console ---------

./Project140.gambas -1 -2 -3 test
./Project140.gambas

--------------------------

On 8/3/23 00:28, Bruce Steers wrote:
>
>
> 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
>
>
> ----[http://gambaswiki.org/wiki/doc/netiquette  ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230803/432e945a/attachment-0001.htm>


More information about the User mailing list