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.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,PP_MIME_FAKE_ASCII_TEXT 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: "Antonio Dur�n Dom�nguez" Subject: RE: Command Line arguments Date: 2000/05/30 Message-ID: #1/1 X-Deja-AN: 630736652 References: <393124B8.846F51E7@mad.servicom.es> <39322C67.C6D9489F@maths.unine.ch> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: usenet@teleline.es X-Trace: telenews.teleline.es 959674083 192.101.1.126 (Tue, 30 May 2000 10:08:03 MET DST) Organization: Clientes_Teleline X-MSMail-Priority: Normal NNTP-Posting-Date: Tue, 30 May 2000 10:08:03 MET DST Newsgroups: comp.lang.ada Date: 2000-05-30T00:00:00+00:00 List-Id: Obviously the example is wrong and it is completely absurd. The intent was to show how to avoid Constraint_Error when getting the arguments by using an Unbounded_String and the code example doesn't show it. Sorry and please forgive me. Antonio Dur�n Dom�nguez escribi� en el mensaje de noticias DEqY4.9613$K4.61152@telenews.teleline.es... > 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; > > with > Gautier escribi� en el mensaje de > noticias 39322C67.C6D9489F@maths.unine.ch... > > Pedro Diaz Jimenez: > > > > a is a fixed-size string (of length 100)! > > Instead of > > > > a := Argument( 2 ); > > put_Line( a ); > > > > Try e.g. > > declare a2: String:= Argument( 2 ); > > begin > > put_Line( a2 ); > > end; > > > > HTH > > ______________________________________________________ > > Gautier -- http://members.xoom.com/gdemont/gsoft.htm > >