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,e17c1684e13bd57b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-22 15:51:06 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out.usenetserver.com!cyclone-pass-sjo.usenetserver.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.frmt1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Newbie - error with 'Limited Type' assignment References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Mon, 22 Jan 2001 23:50:54 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 980207454 24.20.190.201 (Mon, 22 Jan 2001 15:50:54 PST) NNTP-Posting-Date: Mon, 22 Jan 2001 15:50:54 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:4344 Date: 2001-01-22T23:50:54+00:00 List-Id: > 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.