Thanks to all.
Just what I want.
rgds
--
View this message in context:
http://www.nabble.com/Pass-parameter-to-Gambas-prog.-tp25002337p25005719.html
Sent from the gambas-user mailing list archive at Nabble.com.
--
Let
Hi Charles,
You can use the array in Application.Args to retrieve the parameters
passed to the program, taking into account that the first occurrence in
the array is the application own name.
regards,
Toni
En/na charlesg ha escrit:
> Hi all,
>
> Can I pass a parameter to a Gambas program?
> e.g
Hey charlesg,
you might want to experiment with the gb.option and the GetOptions class
here's an example to get you started
DIM opt AS NEW GetOptions("la:b:c:")
IF opt["?"] = 1
PRINT "error parsing the arguments"
ENDIF
IF opt["l"] = 1
PRINT "found option l"
ENDIF
IF opt["a"]
short answer yes
you retrieve it by using Application.Args[index]
nb: Application.Args[0] is the program name
Check in help for more details of how to use.
Steven
On Mon, 2009-08-17 at 00:34 -0700, charlesg wrote:
> Hi all,
>
> Can I pass a parameter to a Gambas program?
> e.g myprog.gambas
Hi all,
Can I pass a parameter to a Gambas program?
e.g myprog.gambas parm1
How do I read the parameter?
Any help gratefully received.
rgds
--
View this message in context:
http://www.nabble.com/Pass-parameter-to-Gambas-prog.-tp25002337p25002337.html
Sent from the gambas-user mailing list arc