Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- M E W E L - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

A stringtable consists of a series of strings and their corresponding
numeric identifiers. In your MEWEL application, you can load a string from
the resource file merely by specifying its identifier. Stringtables are good
to use if you are considering having your application ported to another
language or be customizable by the end user.

Your resource file can have only one STRINGTABLE defined. The resource
compiler supports addition of a number to a string identifier, so you can
have an identifier like ERRMSG_BASE + 100.

MEWEL will try to cache 16 strings at a time in memory. If you try to load
in a string which has the numeric identifier 'n' associated with it, then
MEWEL will cache the strings which have identifiers (n & 16) through (n &
16) + 15. For example, if you load in string 40, then MEWEL will try to
cache the strings with identifiers 32 through 47. The caching will reduce
the number of times that you will need to read the resource file from the
beginning. What this means is that you should try to number your strings
consecutively, and try to arrange logical string groupings in blocks of 16.

Syntax

STRINGTABLE
BEGIN
  identifier1, "string1"
  identifier2, "string2"
  .........
END

Example

#define "errormsg.h"   /* contains the error message id's */

STRINGTABLE
BEGIN
  ERR_OUTOFSPACE,   "You have run out of memory!"
  ERR_FILENOTFOUND, "The file was not found"
  ERR_BADFORMAT,    "An illegal format was encountered"
  ERR_BADFORMAT+1,  "A bad picture clause was found"
END

You can load a string into your application by using the LoadString()
function.

See Also: LoadString

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson