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,bcfc1b9a77ff8cc0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-29 15:03:06 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!diablo.netcom.net.uk!netcom.net.uk!194.72.7.126.MISMATCH!news-peer-test!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: my program Date: Mon, 29 Dec 2003 23:02:16 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host81-129-48-147.in-addr.btopenworld.com X-Trace: sparta.btinternet.com 1072738936 11328 81.129.48.147 (29 Dec 2003 23:02:16 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Mon, 29 Dec 2003 23:02:16 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:3940 Date: 2003-12-29T23:02:16+00:00 List-Id: "Kasia Krysiak" wrote in message news:bspfvv$mpo$1@atlantis.news.tpi.pl... > I'm start to lern ada , and i have some problems... > this is my new program, and i have a question how to inicialize > Task1:Male(Id=>1); Task2:Male(Id=>2); task3:male(id=>3); (last 3 lines of > code in loop? becouse i should to have the number od male dymaic. I tryided > to do this in arry but i couldnt inlicjalize this id's sorry 4 my english > it isnt good I KNOW!!! - but I'm trying :) > task type Male(Id: integer); [snip] > Task1:Male(Id=>1); > > Task2:Male(Id=>2); > > task3:male(id=>3); You can do this at elaboration: package body Foo is Task_Id : Natural := 0; function Get_Id return Positive is begin Task_Id := Task_Id + 1; return Task_Id; end Get_Id; task type Bar (Id : Natural := Get_Id); task body Bar is ... end Bar; Tasks : array (1 .. 3) of Bar; end Foo; The Lawyers can correct me if I'm wrong but elaboration is performed sequentially and therefore the Id's are guaranteed to be unique.