comp.lang.ada
 help / color / mirror / Atom feed
From: John English <je@brighton.ac.uk>
Subject: Re: A big thank you to Bruce or Tracy, Robert  and Ted!!!!!!!
Date: Sun, 07 Jan 2001 01:29:54 +0000
Date: 2001-01-07T01:22:49+00:00	[thread overview]
Message-ID: <3A57C692.A7BC1C5C@brighton.ac.uk> (raw)
In-Reply-To: t4sghie7fam871@corp.supernews.co.uk

Mark Pagdin wrote:
> 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.

Ooh. You will probably find that your lecturer will be gratified to
discover
that you've learned to ask questions when you don't understand
something.
There's nothing more frustrating than talking to an unresponsive class
who
don't stop you and ask questions, but when you ask them questions you
find
that they haven't understood anything you said since the bit where you
said
"Good morning" last Monday.

At Brighton we run "sandwich" courses where students do a year in
industry
between their 2nd and final years. One of the most rewarding results is
that
they come back for their final year and ask questions, rather than
sitting on
their hands and thinking "I must be stupid..." !!!

If you look around this (and other) groups, you'll find that most people
here
have asked the world to help when they've got stumped by something.
Nothing
to be ashamed of at all.

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

Procedure: use as a statement:
   Do_This (Blah, Blah, Blah);

Function: use as an expression:
   This := Do_That(Blah, Blah) + The_Other;

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

Yes. For example, this will work:

  with Mark;
  procedure My_Main_Program is
  begin
    Mark.Do_This;  -- call the procedure Do_This in package Mark
  end My_Main_Program;

Another way to say the same thing:

  with Mark; use Mark;
  procedure My_Main_Program is
  begin
    Do_This;  -- call the procedure Do_This in package Mark
  end My_Main_Program;

> If you can understand what i just wrote then you deserve an MBE.

Oh, thank you... :-)

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.comp.it.bton.ac.uk/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------



      parent reply	other threads:[~2001-01-07  1:29 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
2001-01-07  1:29 ` John English [this message]
replies disabled

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