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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec4a7355f321a22b X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!news3.optonline.net!newshosting.com!nx02.iad01.newshosting.com!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Task discriminants Date: Thu, 20 May 2004 18:37:23 +0000 (UTC) Organization: BT Openworld Message-ID: References: <40ACC50E.9040406@mail.usyd.edu.au> NNTP-Posting-Host: host81-152-56-112.range81-152.btcentralplus.com X-Trace: titan.btinternet.com 1085078243 17050 81.152.56.112 (20 May 2004 18:37:23 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Thu, 20 May 2004 18:37:23 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Xref: controlnews3.google.com comp.lang.ada:711 Date: 2004-05-20T18:37:23+00:00 List-Id: function Next_Id return Integer; task type A_Task (Id : Integer := Next_Id); Id : Integer := 0; function Next_Id return Integer is begin Id := Id + 1; return Id; end Next_Id; The_Tasks : array (1 .. 3) of A_Task; You could consider putting Id and Next_Id in their own package. Cheers -- Martin "David C. Hoos" wrote in message news:mailman.1.1085073466.401.comp.lang.ada@ada-france.org... > How about: > > The_Tasks: array (1 .. 3) of A_Task = > (A_Task (1), > A_Task (2), > A_Task (3) > ); > ----- Original Message ----- > From: "Dave Levy" > Newsgroups: comp.lang.ada > To: > Sent: Thursday, May 20, 2004 9:47 AM > Subject: Task discriminants > > > > Hi > > > > Suppose one has a task type with a discriminant: > > > > task type A_Task( Id : integer); > > > > and one wishes to declare a set of tasks with initialised discriminants: > > t1 : A_Task(1); > > t2 : A_Task(2); > > t3 : A_Task(3); > > > > How could one declare them as an array of tasks with each one getting an > > initialised discriminant? Perhaps something like: > > > > The_Tasks: array (1..3) of A_Task( Id => 1,2,3 ); > > > > Except I tried this with Gnat and it won't compile. > > > > Thanks > > > > Dave > > > > _______________________________________________ > > comp.lang.ada mailing list > > comp.lang.ada@ada-france.org > > http://www.ada-france.org/mailman/listinfo/comp.lang.ada > >