From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed2c270d51f000e1 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: HELP: how to get parameters given to an exe ? Date: 1997/03/26 Message-ID: <01bc3a3f$c3c5c4c0$63f482c1@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 228600530 References: Organization: UUNet PIPEX server (post doesn't reflect views of UUNet PIPEX) Newsgroups: comp.lang.ada Date: 1997-03-26T00:00:00+00:00 List-Id: Ingrid CHESSEL & David EXCOFFIER wrote in article ... > 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.