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,382901ab8b321c3a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-30 16:00:16 PST Path: supernews.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Bruce or Tracy Newsgroups: comp.lang.ada Subject: Re: A big thank you to Bruce or Tracy, Robert and Ted!!!!!!! Date: Sat, 30 Dec 2000 17:53:25 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <3A4E7575.6ECB17F9@hiwaay.net> X-Mailer: Mozilla 4.6 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: supernews.google.com comp.lang.ada:3481 Date: 2000-12-30T17:53:25-06:00 List-Id: Generally speaking: (I say that to keep the flaming down!! :) Use/call a function when your program is wanting to know something like the Sin of an angle or distance between two points - consider a function as being an equation. Procedures are for performing some action, like the get_line procedure which populates a variable with some information or the "Put" procedure that performs output to an output device (screen, file, etc). Procedures will perform an action(s) or populate a complex data structure(s) via "in out" notation in the procedure's spec of the variable(s). Don't feel bad about having several functions, one function to give you every little calculation you wish. I guess I don't deserve an MBE - I don't quite understand the (b) question. Hope it goes well for you, Bruce Mark Pagdin wrote: > > Hi guys, > > Thank you all for your help. I am meant to attept a pretty graphics addition > to the program, but i won't worry about that until I manage the basics. > > I appreciate all your comments. I have been reading about Ada, Arrays etc > but I find i learn from actually doing things, not just reading about them. > I don't really want to lose face with my lecturer/plus he probably has 80 > emails from desperate students like me, hence turning to you guys for help. > > 2 qns, about general Ada: > > a) When does one use a function or a Procedure. I know it is to do with one > not giving an output or something but can anyone give an example of when to > use one rather that another? > b)I use Gnat IDE and I was recomended by my lecturer to use packages and > then procedures/functions in that package can be called. So when i want to > write the Main Program (is that what you call it?) i say "with Mark;" if > Mark is the package and then just write a procedure that calls the names of > the procedures and functions from the package? > > If you can understand what i just wrote then you deserve an MBE. > > Mark > > -