[Gambas-user] gb.args - a question

Bruce bbruen at ...2308...
Fri Feb 15 23:29:41 CET 2013


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")
...


hth
Bruce





More information about the User mailing list