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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ac670d3be4b8f7a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-07 18:48:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!howland.erols.net!newsfeed.mindspring.net.MISMATCH!news.mindspring.net!not-for-mail From: Larry Hazel Newsgroups: comp.lang.ada Subject: Re: A question on function calls and defs. Date: Wed, 07 Mar 2001 20:47:07 -0600 Organization: MindSpring Enterprises Message-ID: <3AA6F2AB.A1A12BD5@mindspring.com> References: NNTP-Posting-Host: c7.ae.9c.c4 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 8 Mar 2001 02:47:10 GMT X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en,x-ns11F8K63r3NhQ,x-ns2r2e09OnmPe2 Xref: supernews.google.com comp.lang.ada:5532 Date: 2001-03-08T02:47:10+00:00 List-Id: mcdoobie wrote: > > 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 The function spec in the .ads file must match the function definition in the body of the package. Sounds as if the compiler is trying to tell you they don't match. Larry