* Re: help: type and packages
1999-02-06 0:00 help: type and packages Ralf Tita
@ 1999-02-05 0:00 ` David C. Hoos, Sr.
0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos, Sr. @ 1999-02-05 0:00 UTC (permalink / raw)
Ralf Tita wrote in message <79g0gg$ppm$1@news.cs.tu-berlin.de>...
>Hi there,
>I'm using ADA83 and have a problem with types in differnt packeges.
>My first package looks like this:
>
>package first is
> ...
> type HAND_T is (open,close);
> ...
>end first;
>
>the second package wich imports the first includes this type in a record:
>
>with first;
>use first;
>package second is
> ...
> type TODO_T is record
> Hand : HAND_T;
> movement: : MOVE_T;
> end record;
> ...
>end second;
>
>-- no problem.
>But when I want to use this record in a third packege wich only imports
>the second package the compiler don't knows the component HAND_T
>of the record.
>
>with second;
>use second;
>package third is
> WhatToDo: TODO_T;
> ...
> WhatToDo.Hand:=open; -- here comes the compiler error
> ....
>end third;
>
You need to say:
WhatToDo.Hand:= First.open;
And, of course you need to add the context clause "with First;"
at the beginning of package third.
A context clause "with some_unit", only includes that unit
into the context.
Hope this helps
David C. Hoos, Sr.
^ permalink raw reply [flat|nested] 2+ messages in thread
* help: type and packages
@ 1999-02-06 0:00 Ralf Tita
1999-02-05 0:00 ` David C. Hoos, Sr.
0 siblings, 1 reply; 2+ messages in thread
From: Ralf Tita @ 1999-02-06 0:00 UTC (permalink / raw)
Hi there,
I'm using ADA83 and have a problem with types in differnt packeges.
My first package looks like this:
package first is
...
type HAND_T is (open,close);
...
end first;
the second package wich imports the first includes this type in a record:
with first;
use first;
package second is
...
type TODO_T is record
Hand : HAND_T;
movement: : MOVE_T;
end record;
...
end second;
-- no problem.
But when I want to use this record in a third packege wich only imports
the second package the compiler don't knows the component HAND_T
of the record.
with second;
use second;
package third is
WhatToDo: TODO_T;
...
WhatToDo.Hand:=open; -- here comes the compiler error
....
end third;
so does anybody knows where the mistake is ?
When you got an solution please send me a mail.
thanks a lot
Ralf Tita
natsulu@cs.tu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-02-06 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-06 0:00 help: type and packages Ralf Tita
1999-02-05 0:00 ` David C. Hoos, Sr.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox