comp.lang.ada
 help / color / mirror / Atom feed
From: "Jim Marley" <jcmarle@qis.net>
Subject: Tagged and General Access Types
Date: 1997/07/25
Date: 1997-07-25T00:00:00+00:00	[thread overview]
Message-ID: <01bc98ea$297f2960$LocalHost@jcmarle> (raw)


I have a problem that I'm really stuck on...I'm sure it's a simple one, but
I'm just not seeing it.

I'm trying to print the values of a 2x array - a spreadsheet
implementation.  The array is an array of pointer and the values are
integers.  Here's what I have:

Type Values is abstract tagged private;
Type Constant_Values is new Values private;
Type Integer_Values is new Constant_Values private;

private
	type Values is abstract tagged null record;
	type Constant_Values is abstract new Values with null record;
	type Integer_Values is new Constant_Values with
		record
		Integer_Values: Integer;
		end record;
(There is a reason for this extention. There's more, I just want to keep it
semi-cloudy)

Then I have the following procedures:

procedure Print(Block: in Blocks) is  -- Block is a  block of Spreadsheet
cells
begin
	for row in Block.from.row..Block.to.row loop
		for column in Block.from.column..Block.to.column loop

		Put(Spreadsheet_Array(row, column).all);

		end loop;
	end loop;
end Print;

procedure Put(Value: in Integer_Values) is
begin
	Int_IO.Put(Value.Integer_Value);
end Put;

My problem is that I get the error " invalid parameter is list call" for
the PUT call in Print.  The two procedures are in two different child
packages.  Print is in Spreadsheet.Interface and Put is in
Spreadsheet.Values.  To avoid a loop during compilation I do the following:

******* spec *******************
package spreadsheet.values is

******* body *******************
with Spreadsheet.Interface; use Spreadsheet.Interface;
package body spreadsheet.values is

****** spec *******************
with Spreadsheet.Values; use Spreadsheet.Values;
package Spreadsheet.Interface is

***** body *****************
package body Spreadsheet.Interface is

**

I hope I've made this clear...probably not.  

Tks

Jim Marley





             reply	other threads:[~1997-07-25  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-25  0:00 Jim Marley [this message]
1997-07-25  0:00 ` Tagged and General Access Types Anonymous
replies disabled

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