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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a2e027c5d59b1c31 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-20 08:06:10 PST Path: bga.com!news.sprintlink.net!mv!news.mathworks.com!europa.eng.gtefsd.com!gatech!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!epflnews!dinews.epfl.ch!di.epfl.ch!Robb.Nebbe From: Robb.Nebbe@di.epfl.ch (Robb Nebbe) Newsgroups: comp.lang.ada Subject: Re: GNAT and Command Line Arguments Date: 20 Oct 1994 11:11:19 GMT Organization: Ecole Polytechnique Federale de Lausanne Sender: nebbe@lglsun3.epfl.ch (Robb Nebbe) Distribution: world Message-ID: <1994Oct20.115433@di.epfl.ch> References: <383amh$95h@hp-col.col.hp.com> NNTP-Posting-Host: lglsun3.epfl.ch Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 1994-10-20T11:11:19+00:00 List-Id: In article <383amh$95h@hp-col.col.hp.com>, jimr@col.hp.com (Jim Rogers) writes: |> |> My current question: |> |> How do I write an Ada program so that I can pass file names in from the |> UNIX command line? I am running GNAT under HPUX. |> The relevant functions from Ada.Command_Line are the following: function Argument_Count return Natural; function Argument( Number : in Positive ) return String; function Command_Name return String; A loop printing out all the command line arguments would be: for Index in 1 .. Argument_Count loop Text_IO.Put_Line( Argument( Index )); end loop; The interface is a little cleaner than what you get in C since the command name, which a system may or may not provide, is not considered as one of the arguments. - Robb Nebbe