[Gambas-user] about Application.Args
Stefano Palmeri
rospolosco at ...152...
Fri Oct 27 18:59:26 CEST 2006
Alle 18:29, venerdì 27 ottobre 2006, Rob ha scritto:
> On Friday 27 October 2006 10:30, Stefano Palmeri wrote:
> > Application.Args.Count returns number of arguments + 1,
> > because of the application name. Is it a feature or bug? I
> > think is more logical that arguments don't count the name of
> > the application.
>
> Having the arguments include the application name is "the C way"
> of doing things. Java and Perl omit the application name. I
> personally expected it to behave as it does, but I can
> understand why it would be confusing.
>
> The reason C does it that way is because you can have a single
> executable with multiple symbolic links to it, and have it do
> different things depending on what name the user ran it under.
> For example, gzip and gunzip are the same program, but behave
> differently depending on which one you run. So there needs to
> be a way to get the actual name of the program, and the name
> under which the user ran it. There's no reason to prevent Gambas
> programs from using this kind of functionality.
>
> I have also seen programs behave differently if you called them
> with an absolute path versus just the name of the program by
> itself.... gbx used to be one of those programs, in fact.
> Again, that's user-supplied data and, in my opinion and 38 years
> of C tradition, belongs in the arguments. Of course, BASIC
> isn't C, but I think Gambas is something beyond BASIC.
>
> > Anyway, the help should be modified:
> > Application.Args
> > Returns an array containing the application name and the
> > arguments passed to the program by the shell.
>
> I'd add a note mentioning that the first argument is always the
> name of the program. In fact, I just did.
>
> Rob
Thanks for very clear, quick reply.
The note in the help is what no C developers (like me) need. Thanks.
Regards,
Stefano Palmeri
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list