[Gambas-user] gb.args - a question
    Willy Raets 
    willy at ...2734...
       
    Fri Feb 15 23:07:38 CET 2013
    
    
  
Hello,
I'm experiencing some trouble implementing gb.args
I made a small testcase named Arguments.
To implement version and help are no problem :)
Now I try to add an argument a (about)
Goal is that:
Arguments -a 
OR
Arguments --about
RETURNS
To test gb.args in GUI application
The code I have is below. I'm not getting any wiser reading the
documentation over and over.
I have tried several different things, ended up with this. But the new
argument still doesn't work.
---- Code module Start (starup class)----
Public Sub Main()
  
  Dim sAbout As String
  Args.Begin("Arguments <options>")
  sAbout = Args.Get("a", "about", "To test gb.args in GUI application")
  Args.End()
  Print sAbout
  FMain.Show
  
End
---- End Code ----
Results in terminal:
1. For: Arguments -h
Arguments <options>
Options:
 -a --about                             To test gb.args in GUI
application
 -V --version                           Display version
 -h --help                              Display this help
2. For: Arguments -V
0.0.1
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.
Thanks,
Willy
    
    
More information about the User
mailing list