String tables can be used to store and retrieve large collections of strings in your application.
A string table looks as follows:
STRINGTABLE { 1, "hello World !"
2, "hello world again !"
3, "last hello world !" }
|
windres -i tests.rc -o tests.res |
program tests;
{$mode objfpc}
Uses Windows;
{$R *.res}
Function LoadResourceString (Index : longint): Shortstring;
begin
SetLength(Result,LoadString(FindResource(0,Nil,RT_STRING),Index,@Result[1],SizeOf(Result)))
end;
Var
I: longint;
begin
For i:=1 to 3 do
Writeln (Loadresourcestring(I));
end.
|