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 X-Google-Thread: 103376,366878aecb8dd427 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-11 13:04:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E496557.4060109@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Random Access in Ada.Text_IO files References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 11 Feb 2003 21:03:05 GMT NNTP-Posting-Host: 63.184.104.71 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1044997385 63.184.104.71 (Tue, 11 Feb 2003 13:03:05 PST) NNTP-Posting-Date: Tue, 11 Feb 2003 13:03:05 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:34008 Date: 2003-02-11T21:03:05+00:00 List-Id: In general, what you're trying to do won't work. Ada.Text_IO is intended for sequential use only. Files are not the appropriate mechanism for intertask communication; it would be better to use a protected object of some sort. Some general Ada concepts you might find useful: Micha� Morawski wrote: > procedure TF is > > NAZWA_PLIKU : constant String := "aaaaaaa"; > > task Wr is > end Wr; This can be written using the special form task Wr; > > task body Wr is > F : File_Type; > ch : Character := 'a'; > begin > Create (F, Out_File, NAZWA_PLIKU, "shared=no"); > loop > Put (F, ch); > ch := Character'Succ (ch); > if ch > 'z' then > ch := 'a'; > end if; > delay 0.01; > end loop; Might I suggest something along the lines of subtype Lower is Character range 'a' .. 'z'; begin Create (File => F, ...); loop for Ch in Lower loop Put (File => F, Item => Ch); delay 0.01; end loop; end loop; > exception > when others => > Put_Line ("Blad w zadaniu"); > end Wr; -- Jeff Carter "You've got the brain of a four-year-old boy, and I bet he was glad to get rid of it." Horse Feathers