Board index » delphi » Creating String Tables

Creating String Tables

Hi over there!

We are questioning how to generate string table resources within DELPHI.
It is quite easy to generate Bitmap resources, but we did not find a way
to create string tables as Windows resources. In the DELPHI sources, there
are String tables, but we do not know the format and how to compile them.

 

Re:Creating String Tables


"Dr. Dietmar Budelsky" <budel...@ibs.bm.eunet.de> wrote:

Quote
>We are questioning how to generate string table resources within DELPHI.
>It is quite easy to generate Bitmap resources, but we did not find a way
>to create string tables as Windows resources. In the DELPHI sources, there
>are String tables, but we do not know the format and how to compile them.

1) Create a text file called "STRINGS.RC" (or whatever you want to
call it) and type in your string tables:

        STRINGS.RC:

        STRINGTABLE
        {
         100, "Hello"
         101, "How are you?"
         102, "Have a nice day!"
        }

You have a string identifier, plus the string itself.

2) Compile this file using the Borland Resource Compiler (or any other
resource compiler you have)
        BRCC STRINGS.RC

This results in a binary resource file STRINGS.RES

3) Include that string table resource file in your Delphi project:
        {$R STRINGS.RES}

Now, you can load the strings from the string resource which is
included in your final .EXE file:

        LoadStr (ID : Word) : String;

Hope this helps!
Marc

======================================================================
[ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
======================================================================

Re:Creating String Tables


On Fri, 27 Jun 1997 12:11:33 +0200, "Dr. Dietmar Budelsky"

Quote
<budel...@ibs.bm.eunet.de> wrote:
>We are questioning how to generate string table resources within DELPHI.
>It is quite easy to generate Bitmap resources, but we did not find a way
>to create string tables as Windows resources. In the DELPHI sources, there
>are String tables, but we do not know the format and how to compile them.

Delphi 3 supports string resources in the compiler, with its new
resourcestring declaration. The great thing about compiler support is
that you no longer need to worry about conflicting string ID numbers.

In D1 and D2, it is unsafe for a component writer to use string
resources. Unlike other resources, you cannot use string identifiers,
so you must use numeric identifiers. There is no way for component
writers to guarantee that their choice of string resource identifiers
will not conflict. Secrets of Delphi 2 presents a workaround for D1
and D2, using a new resource type. D3 solves the problem for real.
--
Ray Lischner            
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

Other Threads