comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin D. Condic" <mcondic-nospam@quadruscorp.com>
Subject: Re: Programming for the World in Ada95
Date: 2000/02/15
Date: 2000-02-15T18:44:14+00:00	[thread overview]
Message-ID: <38A99E37.F355452C@quadruscorp.com> (raw)
In-Reply-To: 88b4oa$ljt$1@wanadoo.fr

Jean-Pierre Rosen wrote:
> declare all your messages as constants in packages, one package per
> language, i.e.
<snip>

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 
=============================================================




  reply	other threads:[~2000-02-15  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 ` Gautier
2000-02-14  0:00 ` Larry Kilgallen
2000-02-16  0:00   ` Robert A Duff
2000-02-14  0:00 ` Ehud Lamm
2000-02-15  0:00 ` Jean-Pierre Rosen
2000-02-15  0:00   ` Marin D. Condic [this message]
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
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