comp.lang.ada
 help / color / mirror / Atom feed
* Visibility of run time instantiated generics
@ 1993-07-16 12:44 Andrew Young
  0 siblings, 0 replies; only message in thread
From: Andrew Young @ 1993-07-16 12:44 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-07-16 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-07-16 12:44 Visibility of run time instantiated generics Andrew Young

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