comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Re: tasks as part of record
Date: Mon, 13 Oct 2014 09:33:40 -0600
Date: 2014-10-13T09:33:40-06:00	[thread overview]
Message-ID: <thS_v.460462$oh4.209167@fx11.iad> (raw)
In-Reply-To: <ee5719cb-5b85-4857-bfab-42fc5ac4c8a9@googlegroups.com>

On 10/13/2014 8:45 AM, compguy45@gmail.com wrote:
>
>
> is there a way to access say Students(4) componenets while inside start entry?
>

Assuming the tasks are declared as:
   task type Student_Task   (This : not null access Student)
   task_type Enrollment_Task(This : not null access Enrollment)
and the records, Student & Enrollment, are as follows:
   type Student(N  : Positive) is limited record
        ID_Number  : Positive range 1 .. N;
        Name       : Unbounded_String;
        Count      : Integer ;
        Student_Op : Student_Task(Student'Access);
    end record;
and
   type Student_Body is arrray(Positive range <>) of Student;
   type Enrollment(Number_of_Students : Positive) is limited record
        Students : Student_Body(1..Number_of_Students);
        Enroll   : Enrollment_Task( Enrollment'Access );
   end record;

THEN
inside the body of Enrollment_Task you could say:
declare
  Quaddius : Student renames This.Students(4);
begin
   -- Do what you will.
end;


  reply	other threads:[~2014-10-13 15:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 13:11 tasks as part of record Stribor40
2014-10-04 13:33 ` Simon Wright
2014-10-04 22:12 ` Stribor40
2014-10-05  7:36   ` Jacob Sparre Andersen
2014-10-05  8:11 ` Niklas Holsti
2014-10-06  3:47   ` Stribor40
2014-10-06  5:43     ` Jeffrey Carter
2014-10-06  7:18     ` Niklas Holsti
2014-10-06  8:00       ` Dmitry A. Kazakov
2014-10-06 11:40         ` G.B.
2014-10-06  8:06       ` Simon Wright
2014-10-06  8:24     ` Simon Wright
2014-10-12 22:33       ` compguy45
2014-10-13  7:32         ` Simon Wright
2014-10-13 14:45           ` compguy45
2014-10-13 15:33             ` Shark8 [this message]
2014-10-18 18:21           ` Stephen Leake
replies disabled

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