From: "mcdoobie" <chainsaw.two.thousand@nospam.dot.home.dot.com>
Subject: A question on function calls and defs.
Date: Thu, 08 Mar 2001 02:30:37 GMT
Date: 2001-03-08T02:30:37+00:00 [thread overview]
Message-ID: <h9Cp6.36748$W05.7418581@news1.rdc1.mi.home.com> (raw)
Alright so I have this code that looks like this...
with Ada.Text_IO, Ada.Float_Text_IO;
use Ada.Text_IO, Ada.Float_Text_IO;
procedure simplemath is
begin
-- The rest of the code to the program would be here --
-- This is the section I have a question on --
if opt_is = 'V'
then Put( Hi_prompt );
Get( aHeight );
the_volume := find_volume( aLength, aWidth, aHeight ); - Trouble here -
NEW_LINE;
----- Cut to the Function itself -----
function find_volume( aLength, aWidth, aHeight : float ) return float is
volume : float
begin
volume := aLength * aWidth * aHeight;
return volume;
end find_volume;
end simplemath;
As you can probably tell, this is a pretty damn simple program. I'm
writing it just for practice with Ada95.
Now, the problem I'm having is that when I attempt to compile this code
it tells me that in my call to the "find_volume" function I have too many
arguments in the call. I'm not at all sure what that means. I'm searching
the compiler docs to find out, however a little insight would be
appreciated.
Now, at the function definition I'm getting the error that it's "not type
conformant" with my simplemath.ads file.(I did write an .ads file which I
used to generate a stub file which was then filled in with code. A really
nice touch to the language suite if you ask me. )
Now, I doubt anyone would want me to upload an entire .ads file to the
newsgroup( or would they?) however I'm assuming that the error message
itself is self-revealing to regular Ada programmers. Could someone point
me in the right direction on this one?
Should I upload the entire source to the newsgroup? Or would that be
considered rude?
Thanks in advance.
mcdoobie
mcdoobie@home.com
next reply other threads:[~2001-03-08 2:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-08 2:30 mcdoobie [this message]
2001-03-08 2:47 ` A question on function calls and defs Larry Hazel
2001-03-08 2:55 ` mcdoobie
2001-03-09 4:55 ` Jeffrey Carter
2001-03-09 20:39 ` mcdoobie
2001-03-10 12:12 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox