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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98e6b29260f70dc7 X-Google-Attributes: gid103376,public From: randhol+abuse@pvv.org (Preben Randhol) Subject: Re: mmmmmmmmmmmm Date: 2000/08/16 Message-ID: #1/1 X-Deja-AN: 658846688 References: <39991c02$0$17111@echo-01.iinet.net.au> <399920FE.556AD44F@Physik.Uni-Magdeburg.de> <39998CC2.A07B01F1@NULL.lmco.com> <399a1b30$0$1055@echo-01.iinet.net.au> X-Complaints-To: usenet@itea.ntnu.no X-Trace: kopp.stud.ntnu.no 966414506 4880 129.241.83.82 (16 Aug 2000 08:28:26 GMT) Organization: Norwegian university of science and technology User-Agent: slrn/0.9.6.2 (Linux) NNTP-Posting-Date: 16 Aug 2000 08:28:26 GMT Newsgroups: comp.lang.ada Date: 2000-08-16T08:28:26+00:00 List-Id: On Wed, 16 Aug 2000 12:19:10 -0700, Damon Carter wrote: [...] >They have told me that i have to use this specification- > > procedure Get_Valid_Integer (The_Integer : out Integer; > Prompt_Text : String := "any integer The_Integer"; > Lower : Integer := Integer'First; > Upper : Integer := Integer'Last); > >I have also been told that "The limits for the integer should not be >hard -wired as literal values into the subprogram code. These limits should >be communicated to the subprogram as actual parameters, received by formal >parameters, say Lower and Upper. These formal parameter values can then be >used in the subprogram to check that a value input by the user is in the >required range. They can also be outpt as part of athe prompting message, >for example, using the Image attribute:" Maybe I'm holding the wrong end of the stick here, but as I see it they mean that one should be able to do a call like this to get a valid integer: Get_Valid_Integer (The_Integer => Result, Prompt_Text => String_From_User, Lower => 1, Upper => 40); -- [1] By changing the lower and upper values one can then easily test for another range. If you are uncertain where to go from here, look at this page: http://goanna.cs.rmit.edu.au/~dale/ada/aln/4_basic_types.html [1] I have typed the lower value 1 and upper value 40 here for clarity. You should use variables or constants in the real program though. -- Preben Randhol - Ph. D student - http://www.pvv.org/~randhol/ "Violence is the last refuge of the incompetent", Isaac Asimov