[Gambas-user] gb.args - Probably a dumb question but ...

Charlie Ogier charlie at cogier.com
Thu Feb 13 17:22:57 CET 2020


This code works for me.

*Public Sub Form_Open()**
**
**  Dim $runtoday As Boolean = True**
**
**  Args.Begin()**
**  If Args.Has("t", "today", "Run plots for today") Then $runtoday = True**
**  Args.End**
**
**  Print $runtoday**
**
**End**
**
*The result is *True* even if there is no *-t*, tested with 'global' and 
local Boolean. This was done in the IDE.

Charlie

On 13/02/2020 09:10, Bruce wrote:
> If Args.Has("t", "today", "Run plots for today") Then $runtoday = True
>
> I have probably done something wrong here but if $runtoday has already 
> been set True then that line, if there is no "-t" on the command line 
> seems to set $runtoday false.
>
> (Unless I have done something stupid somewhere else?)
>
> Any clues? There doesn't seem to be a default value for "If Args.Has" 
> mentioned in the help docs.
>
> tia
> b
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200213/1fe72eca/attachment.html>


More information about the User mailing list