comp.lang.ada
 help / color / mirror / Atom feed
From: "Pascal Obry" <p.obry@wanadoo.fr>
Subject: Re: Programming for the World in Ada95
Date: 2000/02/16
Date: 2000-02-16T19:12:39+00:00	[thread overview]
Message-ID: <88esr7$nff$1@wanadoo.fr> (raw)
In-Reply-To: m3n1p13cmy.fsf@ns59.infomatch.bc.ca

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

Ray Blaak a �crit dans le message ...
>The fix is, of course, named placement holders:
>
>"there are ${total_count} bad things here, ${critical_count} of which
matter"
>


And what about:

function Critical_Error (Total_Count, Critical_Count : in Positive) return
String is
begin
   return "there are" & Positive'Image (Total_Count) & " bad things here,"
      & Positive'Image (Critical_Count) & " of which matter";
end Critical_Error;

Now there is no problem with reordering :)

For a multi-lingual error system a OO design will do as in:

type Error_Message is abstract tagged private;

function Critical_Error (E : Error_Message;
      Total_Count, Critical_Count : in Positive) return string is abstract;

type English_EM is new Error_Message with private;

function Critical_Error (E : English_EM;
      Total_Count, Critical_Count : in Positive) return string is abstract;

type French_EM is new Error_Message with private;

function Critical_Error (E : French_EM;
      Total_Count, Critical_Count : in Positive) return string is abstract;

Pascal.

PS : this code has not been check by any compiler except myself so it could
just not compile :)

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"







  parent reply	other threads:[~2000-02-16  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-14  0:00 Programming for the World in Ada95 John J Cupak Jr
2000-02-14  0:00 ` Ehud Lamm
2000-02-14  0:00 ` Larry Kilgallen
2000-02-16  0:00   ` Robert A Duff
2000-02-14  0:00 ` Gautier
2000-02-15  0:00 ` Jean-Pierre Rosen
2000-02-15  0:00   ` Marin D. Condic
2000-02-15  0:00     ` Ray Blaak
2000-02-16  0:00       ` Pascal Obry
2000-02-16  0:00       ` Larry Kilgallen
2000-02-16  0:00       ` Nick Roberts
2000-02-16  0:00       ` Pascal Obry [this message]
2000-02-16  0:00         ` Ray Blaak
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox