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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT,WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.12.88 with SMTP id w85mr2092339ioi.32.1446640793456; Wed, 04 Nov 2015 04:39:53 -0800 (PST) X-Received: by 10.182.250.169 with SMTP id zd9mr18069obc.1.1446640793433; Wed, 04 Nov 2015 04:39:53 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no2852334igv.0!news-out.google.com!fs1ni7812igb.0!nntp.google.com!i2no4004903igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 Nov 2015 04:39:53 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.243.252.139; posting-account=zd4fUAoAAABZGnAfDxrdJ5Lpts-qUilv NNTP-Posting-Host: 82.243.252.139 References: <87h9l4eeon.fsf@adaheads.sparre-andersen.dk> <39131715-ea95-4188-93a1-a9819aa5472b@googlegroups.com> <87d1vse2nk.fsf@adaheads.sparre-andersen.dk> <590d628d-41d5-454e-ae4d-a3c72e0ac698@googlegroups.com> <097ed1af-f5a3-4b91-843c-124ae349a49a@googlegroups.com> <117ec1cb-834e-4aef-8449-0aa32c05fd27@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <04bfe03d-8296-44ca-81aa-056e7b555556@googlegroups.com> Subject: Re: Re : Simple call of Procedure with Ada.float_text_IO.Get From: comicfanzine@gmail.com Injection-Date: Wed, 04 Nov 2015 12:39:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28214 Date: 2015-11-04T04:39:53-08:00 List-Id: Le mercredi 4 novembre 2015 11:30:29 UTC+1, Simon Wright a =E9crit=A0: > comicfanzine@gmail.com writes: >=20 > >> The first one reads from standard input (the ARM doesn't explicitly sa= y > >> this), and leaves standard input positioned after the last character o= f > >> the float number read. > >> > >> The second one reads from the string From, and Last contains "the inde= x > >> value such that From(Last) is the last character read" (not sure if > >> that's the last character of the number, or one past it, I'd have to > >> experiment). > >> > >> So which do you want? >=20 > > The first one because i don't want procedure get to read a String , i > > only want it to read a numeric_literal(float input) enter by the user > > of the program . >=20 > Well then, >=20 > F : Float; > begin > Get (Item =3D> F); Ok i tried without : "Width : Field :=3D 0" , like you. But still it doesn't compile , see errors as comments . Here is files with correction : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D with Ada.Text_IO; with Identification; -- File : log_in.adb =20 Procedure log_in is Password : Identification.Password_Value; =20 begin Identification.Get (Password =3D> Password); =20 if Password =3D "admin" then Ada.Text_IO.Put_Line (Item =3D> "Welcome, Administrator."); end if; Identification.receive_float; -- missing argument for parameter "Item" in call to "receive_float" dec= lared at identification.ads:10 if virgules'Valid then=20 Ada.Text_IO.Put_Line("A float number was not asked") ; end if; end log_in; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D with Ada.Text_IO; with Ada.float_text_IO; -- File : identification.adb =20 package body identification is procedure receive_float=20 virgules : Float ; begin Get (Item =3D> virgules );=20 Ada.Text_IO.Skip_Line; end receive_float; procedure Get (Password : out Password_Value ) is begin Ada.Text_IO.Put (Item =3D> "Hello, User. What's your name? "); Get_Name : declare Name : String :=3D Ada.Text_IO.Get_Line; begin=20 if Name /=3D "fanzine" then Ada.Text_IO.Put_Line (Item =3D> "You're not Administrator."); receive_float; else=20 Ada.Text_IO.Get (Item =3D> Password);=20 Ada.Text_IO.Skip_Line; Ada.Text_IO.New_Line; end if; end Get_Name;=20 =20 end Get; end identification; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D package identification is subtype Password_Value is String (1..5); =20 procedure Get (Password : out Password_Value); =20 procedure receive_float (Item : out virgules); -- "virgules" is undefined (more references follow) end identification; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D