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,2f5274610845c232 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: I18N gettext style Date: 2000/03/05 Message-ID: #1/1 X-Deja-AN: 593269213 References: X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 952220724 206.170.2.223 (Sat, 04 Mar 2000 17:45:24 PST) Organization: SBC Internet Services NNTP-Posting-Date: Sat, 04 Mar 2000 17:45:24 PST Newsgroups: comp.lang.ada Date: 2000-03-05T00:00:00+00:00 List-Id: >Is there any reason you used print0, print1, print2, instead of >print, print, print? My instinct is to overload them. The only reason is that I was trying to code after midnight. #.# >Or %1 and %2, for compatibility with current systems. How about producing: Hi! Hi! There are 3 widgets! Hi! There are 3 parts, code 1234! Hi! For $99.95 you can buy 3 parts, code 1234! using with ada.text_io, ada.text_io.editing; use ada.text_io, ada.text_io.editing; procedure test is procedure print(s : in string; p1 : in string := ""; p2 : in string := ""; p3 : in string := "") is si : integer := s'first; begin while si <= s'last loop if si < s'last and then s(si) = '%' then case s(si+1) is when '1' => put(p1); when '2' => put(p2); when '3' => put(p3); when others => null; end case; si := si+2; else put(s(si)); si := si+1; end if; end loop; new_line; end print; count : integer := 3; id : integer := 1234; type money is delta 0.01 digits 5; package print_money is new ada.text_io.editing.decimal_output(money); money_picture : constant picture := to_picture("-$$9.99"); price : money := 99.95; begin print("Hi!"); print("Hi! There are%1 widgets!", integer'image(count)); print("Hi! There are%1 parts, code%2!", integer'image(count), integer'image(id)); print("Hi! For%3 you can buy%1 parts, code%2!", integer'image(count), integer'image(id), print_money.image(price, money_picture)); end test;