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

GetResourceStringName

Return name of resource string.

Declaration

Source position: objpas.pp line 102

function GetResourceStringName(

  TableIndex: LongInt;

  StringIndex: LongInt

):Ansistring;

Description

GetResourceStringName returns the name of the resourcestring in table TableIndex with index StringIndex. The name of the string is always the unit name in which the string was declared, followed by a period and the name of the constant, all in lowercase.

If a unit MyUnit declares a resourcestring MyTitle then the name returned will be myunit.mytitle. A resourcestring in the program file will have the name of the program prepended.

The name returned by this function is also the name that is stored in the resourcestring file generated by the compiler.

Strictly speaking, this information isn't necessary for the functioning of the program, it is provided only as a means to easier translation of strings.

Errors

If either TableIndex or StringIndex is zero, an empty string is returned.

See also

SetResourceStrings

  

Set values of all resource strings.

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 Example92;

{ Program to demonstrate the GetResourceStringName function. }
{$Mode Delphi}

ResourceString

  First  = 'First string';
  Second = 'Second String';

Var I,J : Longint;

begin
  { Print names of all resourcestrings }
  For I:=0 to ResourceStringTableCount-1 do
    For J:=0 to ResourceStringCount(i)-1 do
      Writeln (I,',',J,' : ',GetResourceStringName(I,J));
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.