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=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec7fc30600a974ce X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Re: Programming for the World in Ada95 Date: 2000/02/15 Message-ID: <38A99E37.F355452C@quadruscorp.com>#1/1 X-Deja-AN: 586228287 Content-Transfer-Encoding: 7bit References: <38A83838.44A43A7D@res.raytheon.com> <88b4oa$ljt$1@wanadoo.fr> Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 15 Feb 2000 18:44:14 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-15T18:44:14+00:00 List-Id: Jean-Pierre Rosen wrote: > declare all your messages as constants in packages, one package per > language, i.e. While this will work, it does happen at compile time. A better method would be to do it at run time so that an "International" software product would differ only by a simple text file. Short of an OS specific solution, I'd build an error message package that loaded the text at startup from a language specific file and then index all the error messages by an enumerated type. Something like: package Error_Messages is type Error_Type is ( Some_Error, Another_Error, Etc_Errors) ; procedure Display_Message ( Err : in Error_Type) ; -- The rest is an exercise for the student. end Error_Messages ; Clearly, the source code will be language specific, but whatever text you want to associate with "Some_Error" or "Another_Error" could be very dynamic. How elaborate you want to get with selecting the specific error message file would depend on your tastes and how much work you want to do. Of course, this is an overall strategy which is not really Ada specific. A good software design for doing this would be an advantage to any application in any language. MDC -- ============================================================= Marin David Condic - Quadrus Corporation - 1.800.555.3393 1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233 http://www.quadruscorp.com/ m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Capitalism without failure is like religion without sin." -- Allan Meltzer, Economist =============================================================