From: tmoran@acm.org
Subject: Re: Newbie - error with 'Limited Type' assignment
Date: Mon, 22 Jan 2001 23:50:54 GMT
Date: 2001-01-22T23:50:54+00:00 [thread overview]
Message-ID: <yH3b6.16152$Ah2.246888@news1.frmt1.sfba.home.com> (raw)
In-Reply-To: rS2b6.10769$4k4.274074@news2-win.server.ntlworld.com
> The compiler, AdaGIDE, says this is not allowed
> ...
> task body phone_line is
> ...
> accept Start_Lines(Simulation_Data : in FILE_TYPE)
> This_Simulation_Data := Simulation_Data; << error here
> end Start_Lines;
1) You could pass a pointer to the File_Type. Or make an array
of File_Type elements and pass an index to Start_Lines.
2) When an Ada compiler complains about something, it's wise to
think hard about whether you really want to do what you wrote. In
this case, after "end Start_Lines;" you will have two different
tasks reading/writing/closing the same file: the Phone_Line task and
its caller. That's certainly a situation that's highly likely to get
you into trouble. If the caller doesn't actually do anything but
open or create the file it passes to Phone_Line, perhaps it should
instead pass the name and let Phone_Line open/create its own
This_Simulation_Data file.
prev parent reply other threads:[~2001-01-22 23:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-22 22:56 Newbie - error with 'Limited Type' assignment Baldy
2001-01-22 23:50 ` tmoran [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox