comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: A big thank you to Bruce or Tracy, Robert and Ted!!!!!!!
Date: Sun, 31 Dec 2000 00:34:23 GMT
Date: 2000-12-31T00:34:23+00:00	[thread overview]
Message-ID: <92luuf$4v8$1@nnrp1.deja.com> (raw)
In-Reply-To: t4sghie7fam871@corp.supernews.co.uk

In article <t4sghie7fam871@corp.supernews.co.uk>,
  "Mark Pagdin" <mark_pagdin@lineone.net> wrote:
> 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?

This certainly confirms my earlier guess, that you don't know
enough yet to be trying to start coding. This is a VERY
fundamental question. It is sort of like someone who sits down
to play the piano, and first asks "I just have one question
what's the difference between the pedals for my feet and the
levers for my hands" :-)

Well perhaps that's a little too extreme, but it is not that
far off. A procedure carries out some actions, a function
returns a result. This must be discussed in any elementary
Ada book, furthermore, any Ada book is just FULL of examples
of the two, so that's the place to look to study.

What book are you using?

You will simply frustrate yourself if you try to code without
understanding the basics. Actually I would suggest doing a
simpler excercise first (like printing out the squares of
numbers from 1 to 5 using a function to compute the square).

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

Again, any Ada book is FULL of such examples. The short answer
to your question is either qualify the names fully, or use a
USE statement, but I think the first step is to study examples
in your text book.

Then if there is something you can't understand in the text
book, ask your instructor, or failing that, ask here.


Sent via Deja.com
http://www.deja.com/



  parent reply	other threads:[~2000-12-31  0:34 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
2000-12-31  0:34 ` Robert Dewar [this message]
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