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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Sat, 8 May 2010 19:17:33 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1273364255 12563 69.95.181.76 (9 May 2010 00:17:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sun, 9 May 2010 00:17:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:11418 Date: 2010-05-08T19:17:33-05:00 List-Id: "Yannick Duch�ne (Hibou57)" wrote in message news:op.vccvt1ybxmjfy8@garhos... Le Fri, 07 May 2010 23:27:55 +0200, Randy Brukardt a �crit: ... >> It doesn't work very well, either, if you are outputting to a message box >> or >> to a log manager: in both cases the entire message string has to be >> passed >> at once. (That's the case in virtually all of my newer programs.) Not >> many >> real programs do much output to Standard Output. > >There are alternatives, and here are two. > >The first one : the log manager could have an open/close logic to output a >log line. That's what mine does, but its purpose is to serialize logging from all of the tasks in the system, all of which are doing their own thing without any special synchronization. If we tried to write parts of each message, we'd get a bunch of interspersed parts (or we'd have to have a very complex system of saving the parts inside the manager until the entire line is available). The other purpose is to make the logs available for inspection at any time (the programs in question are Windows services, so they run for months at a time); that's why they aren't just held open all the time. ... > Another alternative I have used some months ago, was to use an abstraction > of what a text is : I was passing procedure writing text instead of > strings (to be exact, this was not access to procedures, this was tagged > types with a single method). Interestingly, that's how the tasks find out which particular log they are supposed to be writing to: I pass an access-to-logging-routine. It's also a way to do I/O from Pure/Preelaborated packages. But you need two such routines if you plan to allow separating basic writing and ending of a line: New_Line is not a character, you know! (At least not if you are writing a portable Ada program, and want to work on many different targets.) > I'm not to say this is an easy suitable for beginners (as we were also > talking about ease of access for beginners), I'm just exposing this as > example alternatives to the one-string-bulk way. But none work very well, because you still have to identify the end of the line. Either you have to designate a magic character for that purpose, leaving Ada far behind (and also requiring scanning each string as well), or you need multiple routines (as Text_IO does). Whole line at a time is easiest, IMHO, and matches what you want to do enough of the time that there isn't much advantage to doing anything else. YMMV. Randy.