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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dfbdf0cec19e98c6 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Where'd the PAL go? Date: 1999/03/31 Message-ID: <7dtq58$989$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 461238096 References: <36FF1318.E0542579@wvu.edu> <3701C1A0.F6956956@wvu.edu> X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Mar 31 18:39:37 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-03-31T00:00:00+00:00 List-Id: In article <3701C1A0.F6956956@wvu.edu>, Mike Werner wrote: > Matthew Heaney wrote: > > Were the things you found easier to do in C than in Ada? There may be a > > simpler but non-obvious way to do it in Ada. > > Actually, one thing about C that I prefered over the Ada version was the > IO statements - i.e. put and get. I like being able to put the entire > thing on one line, text and variables and the line feed. If there's an > Ada equivalent I'd love to know about it. If not, perhaps I'll create Sure. Just use Put_Line, and the 'image attribute on any numeric values. "&" can be used to tack strings together. eg: for Loop_Count in 1..5 loop Text_IO.Put_Line ("We have executed" & Integer'image(Loop_Count) & " loop(s)."); end loop; should produce: We have executed 1 loop(s). We have executed 2 loop(s). We have executed 3 loop(s). We have executed 4 loop(s). We have executed 5 loop(s). Admittedly this doesn't give you the powerful formatting capabilities that are available in C's printf. But the cool thing is that the same string can be used in an assignment statement as well. You can also pass it to other routines for further processing. Combine that with the routines in the Ada.Strings packages, and I think Ada's string handling is actually more powerful and more convienent than C's. T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own