comp.lang.ada
 help / color / mirror / Atom feed
From: agate!doc.ic.ac.uk!ajy@ucbvax.Berkeley.EDU  (Andrew Young)
Subject: Visibility of run time instantiated generics
Date: 16 Jul 93 12:44:45 GMT	[thread overview]
Message-ID: <2267rtINNidk@frigate.doc.ic.ac.uk> (raw)

I have a problem. I hope this is the right group to find someone to help me.

I have an object representing a schedule table. The size of the table is not
known until run-time. Therefore, I have a generic package TABLE where the SIZE
is given as a generic parameter, and there is internal data of type
         array (1..SIZE) of frame.

So far so good. There is another package that creates the table and stuffs
entries into it. The logic here is

begin
  -- calculate size of table needed
  .....
  declare
    package schedule_table is new table(size);
  begin
    STUFF_ITEMS; -- internal routine to stuff items into schedule table

    SCHEDULE_TABLE.REPORT; -- dump contents of table, for testing
  end;
end;

My problem is that the instantiated generic is only visible in the inner
block. I think I need to pass it as a parameter to the STUFF_ITEMS procedure
so that it can call the procedures provided by the TABLE package. How do
I do this? Or am I doing it completely wrong.

Thanks in advance for any help.

Andy.

                 reply	other threads:[~1993-07-16 12:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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