comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: HELP: how to get parameters given to an exe ?
Date: 1997/03/26
Date: 1997-03-26T00:00:00+00:00	[thread overview]
Message-ID: <01bc3a3f$c3c5c4c0$63f482c1@xhv46.dial.pipex.com> (raw)
In-Reply-To: Pine.SOL.3.95.970326130156.12841A-100000@java



Ingrid CHESSEL & David EXCOFFIER <linfo14@univ-savoie.fr> wrote in article
<Pine.SOL.3.95.970326130156.12841A-100000@java>...
> I'd want to code in Ada83 to following thing:
> 
> I wan't the user be able to pass parameters after the name of the exe
file
> i wrote.
> 
> e.g.:  myprog arg1 arg2 ...
> 
> like in Unix: ls -l    (i want to get this "-l") parmeter
>      or Dos:  dir a:   ( the "a:")
> 
> Is there a possibility to code this kinda thing in Ada 83, under Unix ???
> 
> (I think under Unix or dos, the code in Ada might be the same...)

Your Ada compiler manual should give you information on how to do this.
Perhaps in (the now infamous) 'Appendix F'. This is something which is
likely to be implementation dependent.

The information in your manual may give you only half the solution, such as
"the program invocation string can be retrieved by making a call to ..."
for example. You may need to program your own extra functionality in order
to get the behaviour you require (e.g., following the previous example,
separating out the parameters by finding spaces in the invocation string).
In this case, you should ENCAPSULATE the code which gives this extra
functionality (in a subprogram or package), and make sure that the
interface to this module is well defined. Then, in order to port to another
implementation, you need only change the module; everything else can stay
the same (providing you keep to the rules of the interface). See also: the
thread on "FORTRAN's Equivalence".

Nick.





  parent reply	other threads:[~1997-03-26  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-26  0:00 HELP: how to get parameters given to an exe ? Ingrid CHESSEL & David EXCOFFIER
1997-03-26  0:00 ` Tom Moran
1997-03-26  0:00 ` Nick Roberts [this message]
1997-03-27  0:00 ` Bob Klungle
1997-03-27  0:00 ` Gabriel Bereny
1997-03-28  0:00 ` David C. Hoos, Sr.
1997-03-28  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox