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,a046ce7f5ee1fa51 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-02 07:49:46 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: new_line in a put_line User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Mon, 2 Dec 2002 15:49:29 GMT Content-Type: text/plain; charset=us-ascii References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:31346 Date: 2002-12-02T15:49:29+00:00 List-Id: "Vlad" writes: > Is there a way of prepending a new_line to a put_line. > The reason I need this is that I have multiple tasks outputing to a\ > single file. Some of them use Text_IO.Put rather then Text_IO.Put_Line. > And because of this, some of these outputs get written on the same line > as my outputs. You seem to be assuming that each call to Put or Put_Line is atomic. That's not true, so inserting a new-line into the string passed to Put_Line is not a correct solution. If one task says: Put_Line("Hello"); and another task simultaneously says: Put_Line("Goodbye"); the program is erroneous, which means it can have totally unpredictable behavior. It might intersperse the characters, so you get: HelGoodl obye or it might print what you want: Hello Goodbye or it might crash, or anything else. What you need to do is synchronize your accesses to the standard output file, perhaps using a protected object. - Bob