To get the resource id of a resourcestring, you can cast the address of the string to the PResStringRec
type then access the Identifier
value.
Try this sample
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
resourcestring
rsExample = 'Example';
begin
try
Writeln(rsExample);
Writeln(PResStringRec(@rsExample)^.Identifier);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
readln;
end.