comp.lang.ada
 help / color / mirror / Atom feed
From: "M. Kotiaho" <mark.kotiahoNULL@NULL.lmco.com>
Subject: Re: Help!! program doesnt run, has 0 errors
Date: 2000/08/15
Date: 2000-08-15T00:00:00+00:00	[thread overview]
Message-ID: <39998CC2.A07B01F1@NULL.lmco.com> (raw)
In-Reply-To: 399920FE.556AD44F@Physik.Uni-Magdeburg.de

Gerald Kasner wrote:

> Damon Carter schrieb:
> >
> > I have written a get_valid_integer procedure that gets the input from the
> > user, an integer between 1 and 40,
>
> I can't find any "Get" procedure in your code
>
> > then outputs to the user the number they
> > have entered if it was within the correct range and if not then it raises a
> > range_error and loops so the user can re-enter the number.
>
> Your procedure calls itself ??? have a closer look at this line .....
>
> > When compiled the
> > program has no errors but i cant get it to run.. can anyone help.. i have
> > attached the source code thanx
> >
> >
> Compiler ? switches ? platform ?
>
>                             Name: get_valid_integer.adb
> >    get_valid_integer.adb    Type: Ohne Angabe (application/octet-stream)
> >                         Encoding: x-uuencode
>
> I suggest to have a look at some Ada-book, Feldman&Koffman or Skansholm
>
> -Gerald

In addition to these problems, it is likely that when you compile your procedure,
you are not actually getting an executable file -- just an object file.  A main
Ada program must be parameterless.  If you are trying to use command line
arguments, you need to implement some OS specific code.  If you want your program
to run as is, you could try enclosing it in a main procedure, something like:

with Text_Io;
procedure Show_Me_The_Bugs is
    The_Integer : integer;
    procedure Get_Valid_Integer (The_Integer : out Integer;
    ...
    ...
    end Get_Valid_Integer;
begin
    Get_Valid_Integer (The_Integer);
end Show_Me_The_Bugs;


Of course, even if this does compile and run, it is not going to do what you
wanted it to do.
I'm guessing you might see output like:

Please enterany integer value > 0 and < 41
Please enterany integer value > 0 and < 41
Please enterany integer value > 0 and < 41
Please enterany integer value > 0 and < 41
Please enterany integer value > 0 and < 41
Please enterany integer value > 0 and < 41
...
...

There is no place in your code that you do a "get" from the user.

As Mr. Kasner suggested, you should probably take a look at an Ada textbook ...
just about any one should suffice.

--
MK






  reply	other threads:[~2000-08-15  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 [this message]
2000-08-16 19:19     ` mmmmmmmmmmmm Damon Carter
2000-08-16  0:00       ` mmmmmmmmmmmm Preben Randhol
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