comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Tasks with discriminants
Date: 1997/12/02
Date: 1997-12-02T00:00:00+00:00	[thread overview]
Message-ID: <3483F43C.276491E0@elca-matrix.ch> (raw)
In-Reply-To: 3483C38C.1FF2@home.com


Larry Coon wrote:

>      task type t (task_no: integer);

> But if I want to declare an array of tasks, I
> can't figure out how to supply values for the
> discriminants:
> 
>      type task_array is array (1..3) of t;
>      my_tasks: task_array;   -- ????
> 
> Can anybody tell me how the discriminants are
> supplied in this case?  Thanks in advance.

You can't do this in a way that My_Tasks(i).task_no = i for all i in
My_Tasks'Range. But you can make sure all tasks are initialized with a
distinct value of task_no, and that is described in the Ada 95 Rationale:
<http://www.adahome.com/LRM/95/Rationale/rat95html/rat95-p2-9.html#6>.




  reply	other threads:[~1997-12-02  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-02  0:00 Tasks with discriminants Larry Coon
1997-12-02  0:00 ` Mats Weber [this message]
1997-12-02  0:00 ` Gerald Kasner
1997-12-11  0:00 ` Joh Harbaugh
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox