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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,71c7addfc8ec82f6 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: Command Line arguments Date: 2000/05/29 Message-ID: <39329975.3C449185@acm.org>#1/1 X-Deja-AN: 628676284 Content-Transfer-Encoding: 8bit References: <393124B8.846F51E7@mad.servicom.es> <39322C67.C6D9489F@maths.unine.ch> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 959621061 63.10.52.69 (Mon, 29 May 2000 10:24:21 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Mon, 29 May 2000 10:24:21 PDT Newsgroups: comp.lang.ada Date: 2000-05-29T00:00:00+00:00 List-Id: "Antonio Dur�n Dom�nguez" wrote: > > Another alternative: > > with Ada.Command_Line; > with Ada.Strings.Unbounded; > with Ada.Text_IO; > > use Ada.Command_Line; > use Ada.Strings.Unbounded; > use Ada.Text_IO; > > procedure Print_Args > is > begin > for I in 1 .. Argument_Count loop > Put_Line( > "Argument " & Integer'Image(I) & ": " & > To_String(To_Unbounded_String(Argument(I)))); > end loop; > end Print_Args; This is a terrible suggestion. If the idea is to store a specific argument for some reason, then one of these ways is appropriate: Way_1 : Unbounded_String := To_Unbounded_String (Argument (2) ); Way_2 : [constant] String := Argument (2); If the idea is just to output the argument, as above, then one can simply say: Put_Line (Argument (2) ); -- Jeff Carter "Your mother was a hamster and your father smelt of elderberries." Monty Python & the Holy Grail