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-Thread: 103376,d154e1596a6ac2d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!80.239.144.83.MISMATCH!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!news.banetele.no!news.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Newbie: Task parametering Date: Mon, 17 Oct 2005 12:02:43 +0200 Organization: Jacob's private Usenet server Message-ID: References: <4352ef15$0$28225$5a62ac22@per-qv1-newsreader-01.iinet.net.au> <1129510387.675070.134750@g14g2000cwa.googlegroups.com> <43532f82$0$28244$5a62ac22@per-qv1-newsreader-01.iinet.net.au> NNTP-Posting-Host: hugin.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: jacob-sparre.dk 1129543365 2003 156.148.71.67 (17 Oct 2005 10:02:45 GMT) X-Complaints-To: sparre@jacob-sparre.dk NNTP-Posting-Date: Mon, 17 Oct 2005 10:02:45 +0000 (UTC) User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:+i11QBVqECiz/6OQnPTkosKM9JQ= Xref: g2news1.google.com comp.lang.ada:5743 Date: 2005-10-17T12:02:43+02:00 List-Id: Andrew Price wrote: >> Andrew Price wrote: >>> type Task_Handle is access A_Task; -- used to point to the task >>> Another_Task : Task_Handle; >>> type Data_Handle is access Task_Data; -- used to point to its data >>> Data_For_Task : Data_Handle; >>> >>>begin -- The main prog will now spawn three of the above tasks >>> >>> -- Parameterise the first task and then start it. >>> Data_For_Task := new Task_Data; >>> Data_For_Task.Name := "Task A "; >>> Data_For_Task.Period := 0.5; >>> Data_For_Task.Repetitions := 5; >>> Another_Task := new A_Task(Data_For_Task); > I thought that the task would not start running until the statement > > Another_Task := new A_Task(Data_For_Task); > > which occurs after the values in the Data_For_Task record have been > set? That is also my understanding. > I originally wanted to just use multiple discriminants to initialise > the task however I ran into compilation errors because > "discriminants must have a discrete or access type" and I wanted to > include a string among the initialising variables. You would have to pass an access value to a string (constant) instead of a string. Or maybe an access to your Task_Data type. Greetings, Jacob -- �I'm perfectly happy with my current delusional system.� -- Mirabel Tanner