comp.lang.ada
 help / color / mirror / Atom feed
From: randhol+abuse@pvv.org (Preben Randhol)
Subject: Re: mmmmmmmmmmmm
Date: 2000/08/16
Date: 2000-08-16T08:28:26+00:00	[thread overview]
Message-ID: <slrn8pkk3o.efh.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: 399a1b30$0$1055@echo-01.iinet.net.au

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




  reply	other threads:[~2000-08-16  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-15  0:00 Help!! program doesnt run, has 0 errors Damon Carter
2000-08-15  0:00 ` Gerald Kasner
2000-08-15  0:00   ` M. Kotiaho
2000-08-16 19:19     ` mmmmmmmmmmmm Damon Carter
2000-08-16  0:00       ` Preben Randhol [this message]
2000-08-16  0:00       ` mmmmmmmmmmmm Preben Randhol
2000-08-16  0:00   ` Help!! program doesnt run, has 0 errors Martin Dowie
2000-08-15  0:00 ` Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox