[Gambas-user] gb.args - a question
Willy Raets
willy at ...2734...
Sat Feb 16 02:55:22 CET 2013
On Sat, 2013-02-16 at 08:59 +1030, Bruce wrote:
> On Fri, 2013-02-15 at 23:07 +0100, Willy Raets wrote:
>
> >
> > 3. For: Arguments -a
> > Arguments: argument missing for option -a
> >
> > How do I get this -a to work? What am I missing?
> > Any suggestions or a small example would do miracles.
> >
>
> Args.Get(...) returns a string value, as you have correctly coded
> "sAbout = Args.Get("a", "about", "To test gb.args in GUI application")"
>
> So, if you run the project using just
> ./projname -a
> then it correctly says "argument missing for option -a".
>
> Solution:
> 1. Fix user :-)
>
> If you just want a program option, that is one that does not have an
> associated value, then use Args.Has()
>
> e.g.
>
> Dim sAOption as Boolean
> ...
> sAOption=Args.Has("a",""about", "To test gb.args in GUI application")
> ...
>
>
Thanks Bruce,
I tried this but instead of <appname> -a returning the info required it
launches the application and thus is not recognised as a argument!!
I did remove:
sAbout = Args.Get("a", "about", "To test gb.args in GUI application")
Did it have to stay in?
And what if where now the line:
"To test gb.args in GUI application"
it should actually say:
"Display about"
as I see it when doing a <appname> -h
And when doing the <appname> -a it should give:
"To test gb.args in GUI application"
So that should be the value returned, but how to return the value?
And how to get the argument recognized?
Willy
More information about the User
mailing list