[next] [prev] [prev-tail] [tail] [up]

#### SetResourceStrings

Declaration:
  TResourceIterator = Function (Name,Value : AnsiString;Hash : Longint):AnsiString;

  Procedure SetResourceStrings (SetFunction : TResourceIterator);

Description:
  SetResourceStrings calls SetFunction for all resourcestrings in the resourcestring tables and sets the resourcestring’s current value to the value returned by SetFunction.

  The Name,Value and Hash parameters passed to the iterator function are the values stored in the tables.

Errors:
  None.
See also:
  GetResourceStringCurrentValue (602), GetResourceStringDefaultValue (603), GetResourceStringHash (604), GetResourceStringName (605), ResourceStringTableCount (611), ResourceStringCount (610)

Listing: refex/ex95.pp

Program Example95;
{ Program to demonstrate the SetResourceStrings function. }
{$Mode objfpc}
ResourceString
First = 'First string';
Second = 'Second String';
Var I,J : Longint;
S : AnsiString;
Function Translate (Name,Value : AnsiString; Hash : longint): AnsiString;
begin
Writeln ('Translate (',Name,') => ',Value);
Write ('->');
Readln (Result);
end;
begin
SetResourceStrings(@Translate);
Writeln ('Translated strings : ');
For I:=0 to ResourceStringTableCount-1 do
For J:=0 to ResourceStringCount(i)-1 do
begin
Writeln (GetResourceStringDefaultValue(I,J));
Writeln ('Translates to : ');
Writeln (GetResourceStringCurrentValue(I,J));
end;
end.

[next] [prev] [prev-tail] [front] [up]