[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'objpas' (#rtl)

SetResourceStrings

Set values of all resource strings.

Declaration

Source position: objpas.pp line 97

procedure SetResourceStrings(

  SetFunction: TResourceIterator;

  arg: pointer

);

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

  

Return current value of resourcestring

GetResourceStringDefaultValue

  

Return default (original) value of resourcestring

GetResourceStringHash

  

Return hash value of resource string

GetResourceStringName

  

Return name of resource string.

ResourceStringTableCount

  

Return number of resource string tables

ResourceStringCount

  

Return number of resource strins in table

Example

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.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.