Please enable JavaScript to view this site.

ESL Documentation

The ESL compiler creates or appends to a resource file when external strings are enabled. If the program has previously been compiled with external strings and the compiler finds the resource file, it will read in that file so strings will have the same identifier numbers.

The resource file can be edited before it is used for recompilation. This can be useful for grouping of external strings by logical component of the applications, marking strings which should not be translated, reserving space for future strings, and adding user-defined strings to be loaded byid.

The ESL compiler only needs a small subset of the kinds of information that can be put in a resource file. The only statements that can be used in a resource file used by the ESL Compiler are stringtable, rcinclude, and comments.

Resource File Statement

Meaning

rcinclude filename

Read in a resource include file; it can contain the same statements as in a resource file.

/* Comment */

Comment

/* notxs "string" ["string"] ... */

List strings that should not be externalized. This special kind of comment is recognized by the ESL compiler. This can be useful for strings that are used in expressions or to initialize variables or constants, but should not be translated; for example, strings used to communicate with other applications.

If adding this statement to an existing resource file, be sure to remove any external string definitions for these strings already in the file.

stringtable begin ID "string"

[ID "string" ] ... end

Define external strings. Each string table may have one or more strings defined in it. The string id may be between 1 and 65535; all the string ids in a single DLL must be unique. When the ESL compiler finds new external strings, it uses the next id that is higher than all ids assigned so far.

Resource File Strings

The maximum size of a string in a resource file is 254 characters. Be careful with strings longer than about half to two-thirds of that length, since translation can significantly increase the length of a string.

The format of escape characters allowed in strings in a resource file is different than those allowed in ESL strings. The resource file format is used when the compiler writes out external string definitions and when it shows warning or error messages related to external strings.

The following table lists the ESL strings, the corresponding resource file strings, and their meaning.

ESL Strings

Resource

File Strings

Meaning

\"

""

Quotation mark

\\

\\

Backslash

\b

\x08

Backspace

\e

\x1b

Escape

\f

\x0c

Form feed (new page)

\n

\x0a

Line feed (new line)

\r

\x0d

Carriage return

\t

\t

Tab (horizontal)

\v

\x0b

Tab (vertical)

\^A to \^Z

\x01 to \x1a

(hex)  

Control characters (Some of these characters are shown as symbols.)

Example

The following code shows an example of this.

 

rcinclude XSCommon.RC 

 

/* notxs " " "\xOa" "\t"                       */ 

/* Just whitespace.                              */ 

/* notxs "select" "insert" "delete"         */ 

/* Used to communicate with a program. */ 

 

stringtable begin 

1 "~File" 

2 "~Open" 

3 "~Save" 

4 "~Close" 

5 "E~xit" 

6 "~Language" 7 "English" 

8 "French" 

9 "German" 

10 "Italian" 

11 "Enter Text" 12 "-Upper" 

13 "~Mixed" 

14 "~Lower" 

15 "Not Found" 

16 "Cannot load database ""%l""\xOa" end