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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:568b:: with SMTP id h11mr12994625qta.197.1586446723583; Thu, 09 Apr 2020 08:38:43 -0700 (PDT) X-Received: by 2002:a05:6830:148d:: with SMTP id s13mr402990otq.342.1586446723047; Thu, 09 Apr 2020 08:38:43 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 9 Apr 2020 08:38:42 -0700 (PDT) In-Reply-To: <5e8edf69$0$18432$e4fe514c@news.kpn.nl> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=185.22.143.122; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 185.22.143.122 References: <5e8edf69$0$18432$e4fe514c@news.kpn.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Using Generic Pasckages From: AdaMagica Injection-Date: Thu, 09 Apr 2020 15:38:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:58337 Date: 2020-04-09T08:38:42-07:00 List-Id: Am Donnerstag, 9. April 2020 10:40:11 UTC+2 schrieb ldries46: > I have created some generic packages. tese are packages that only do the= =20 > same thing but with other types. Till now I did only need these packages= =20 > without interaction with between packages using the same type. I just=20 > can declare them: > Package AA is new BB(type); then calling them as > A :=3D AA.Get_Value; > No other declaration seemed to be neccesary . >=20 > Now I have the following situation: > Package AA is new BB(integer); > Package CC is new BB(integer); > and a case where I have several statements using Package AA in one=20 > condition and CC the other case. > I want=C2=A0 to do that by using: > if D then EE :=3D AA; else EE :=3D CC; end if; You cannot assign packages. Why not: if D then AA.Get_Value; else CC.Get_Value; end if;