From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: help: type and packages
Date: 1999/02/05
Date: 1999-02-05T00:00:00+00:00 [thread overview]
Message-ID: <BOJYjNWU#GA.182@pet.hiwaay.net> (raw)
In-Reply-To: 79g0gg$ppm$1@news.cs.tu-berlin.de
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.
prev parent reply other threads:[~1999-02-05 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-06 0:00 help: type and packages Ralf Tita
1999-02-05 0:00 ` David C. Hoos, Sr. [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox