speaking of strings...

From: Edward J Glamkowski (eglamkowski@angelfire.com)
Date: 04/22/02


I know George and Jeremy will kill me for suggesting this, but...

There's a lot of strings in the code - since so much of it is
already outside the code (lib/text, world files, etc.), might it
be worthwhile to do some resource compiler thing so the mud uses
external stringtables?  Completely eliminate all text in the code
and use ID references, so when you want to print a string, you do
something like:

send_to_char(ch, Stringtable->GetString(STR_YOU_HAVE_DIED));

The stringtable struct is quite trivial:
struct sStringEntry
{
        int32 ID;
        char *Value;
};

class cStringTable
{
private:
        int32 Count;
        sStringEntry *Strings;

public:
        cStringTable( char *szFile, char *szName );
        ~cStringTable( void );

        char *GetString( int ID );
};


Well, that's a C++ object, but trivial enough to do it in C instead.

And then you need a simple resource compiler - I've written one
myself that covers a lot more then just string tables  :)
(buttons, scrollbars, edit fields, etc.).

That way someone writing a mud in some other language (like
Canadian, appearently :)  can just edit one file for text strings
and not have to sift through every line of every module...




Is your boss reading your email? ....Probably
Keep your messages private by using Lycos Mail.
Sign up today at http://mail.lycos.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT