From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ed99b77c3c94624,start X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: help: type and packages Date: 1999/02/05 Message-ID: #1/1 X-Deja-AN: 441187168 References: <79g0gg$ppm$1@news.cs.tu-berlin.de> Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: 1999-02-05T00:00:00+00:00 List-Id: 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.