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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.28.101 with SMTP id a5mr2740809igh.9.1446296011987; Sat, 31 Oct 2015 05:53:31 -0700 (PDT) X-Received: by 10.182.87.229 with SMTP id bb5mr145666obb.3.1446296011835; Sat, 31 Oct 2015 05:53:31 -0700 (PDT) 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!i2no1143967igv.0!news-out.google.com!fs1ni3875igb.0!nntp.google.com!i2no1143964igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 31 Oct 2015 05:53:31 -0700 (PDT) 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 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4d618dd3-3bc1-4afc-8e74-78aca76b0b09@googlegroups.com> Subject: Simple call of Procedure in package from a main program From: comicfanzine@gmail.com Injection-Date: Sat, 31 Oct 2015 12:53:31 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28148 Date: 2015-10-31T05:53:31-07:00 List-Id: Hello everyone , I have a simple main program , who call a procedure in a package but it not= compile . In total , i have 3 files(1 main program , 1 packagefile.adb , a= nd , 1 packagefile.ads) : user_or_admin.adb(main program) : [code]with ada.text_io ; use ada.text_io ; with identification; use identification; Procedure User_or_admin is =20 begin New_Line ;=20 Put_line("Hello user, what's your name"); =20 yes_or_no; =20 if Password =3D "admin" then Put_Line("Welcome administrator"); end if; end User_or_admin ; [/code=3Dada] identification.adb(packagefile) [code]with ada.text_io ; use ada.text_io ; package identification is Procedure yes_or_no is =20 Password : String(1..5) ; Begin declare=20 =20 name : String :=3D ada.text_io.get_line ;=20 begin if name =3D "fanzine"=20 then Put("what is the password : ") ; Get(Password) ; New_Line ; Skip_line ; elsif name /=3D "fanzine" then Put_line("You're not administrator") ;=20 =20 end if; end ; =20 end yes_or_no; end identification;[/code=3Dada] identification.ads(packagefile) [code]package identification is Procedure yes_or_no (Password : String ); =20 end identification;[/code=3Dada] If you stil don't understand what i want to do after reading the files , i = explain : In the main program , after Put_line i want to have the procedure in the pa= ckagefile be executed , so after the Hello[...] : do the get_line which is = in the packagefile and do the "if-then" condition after it , and finaly if = this "if-then" condition is valid , do the Password condition .=20 Don't hesitate to correct the files if you think what i want to do correspo= nd what you doing .=20 Thanks for you time , it is always a pleasure to code in Ada and have the h= elp of others ada programers .=20