comp.lang.ada
 help / color / mirror / Atom feed
* Tagged and General Access Types
@ 1997-07-25  0:00 Jim Marley
  1997-07-25  0:00 ` Anonymous
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Marley @ 1997-07-25  0:00 UTC (permalink / 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tagged and General Access Types
  1997-07-25  0:00 Tagged and General Access Types Jim Marley
@ 1997-07-25  0:00 ` Anonymous
  0 siblings, 0 replies; 2+ messages in thread
From: Anonymous @ 1997-07-25  0:00 UTC (permalink / raw)



On 25 Jul 1997 11:03:57 GMT, "Jim Marley" <jcmarle@qis.net> wrote:
..
> Type Constant_Values is new Values private;

Do you mean "new Values with private;"?

> 	type Integer_Values is new Constant_Values with
> 		record
> 		Integer_Values: Integer;
> 		end record;

Will your compiler allow you to have a type names Integer_Values with a
component named Integer_Values?

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

What is the designated type of the access type that is the component
type of Spreadsheet_Array? If it doesn't designate Integer_Values or
Integer_Values'Class, then you will get this message.

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"We burst our pimples at you."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/










^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-07-25  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-25  0:00 Tagged and General Access Types Jim Marley
1997-07-25  0:00 ` Anonymous

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