comp.lang.ada
 help / color / mirror / Atom feed
From: Bruce or Tracy <bljacobs@hiwaay.net>
Subject: Re: A big thank you to Bruce or Tracy, Robert  and Ted!!!!!!!
Date: Sat, 30 Dec 2000 17:53:25 -0600
Date: 2000-12-30T17:53:25-06:00	[thread overview]
Message-ID: <3A4E7575.6ECB17F9@hiwaay.net> (raw)
In-Reply-To: t4sghie7fam871@corp.supernews.co.uk

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
> 
> -



  reply	other threads:[~2000-12-30 23:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30 20:14 A big thank you to Bruce or Tracy, Robert and Ted!!!!!!! Mark Pagdin
2000-12-30 23:53 ` Bruce or Tracy [this message]
2000-12-31  0:34 ` Robert Dewar
2001-01-07  1:29 ` John English
replies disabled

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