The situation is:
unit abc;
interface
resourcestring
aabbcc = \'my text here\';
implementation
end.
From my application I received er
I imagine you're asking for a function with the following signature and behavior:
function GetNamedResourceString(const Name: string): string;
Assert(GetNamedResourceString('aabbcc') = 'my text here');
Resource strings are stored in your program in a string-table resource, where each string has a numeric index. The named identifier you use in your program is not kept anywhere at run time. Therefore, there is no built-in way to take the text 'aabbcc' and discover which string resource it's associated with.
However, there is a way to take the Delphi resourcestring identifier in your code and discover its numeric ID. Type-cast the expression @aabbcc to PResStringRec, and then read its Identifier field. Look at LoadResString in System.pas to see how the RTL uses this information.
You could use the PResStringRec values to build a TDictionaryGetNamedResourceString function outlined above.
NamedResources := TDictionary.Create;
NamedResources.Add('aabbcc', PResStringRec(@aabbcc));
function GetNamedResourceString(const Name: string): string;
begin
Result := LoadResString(NamedResources[Name]);
end;
If I were doing this for a real project, I would probably use a pre-build script to parse an input file to automatically generate the calls to NamedResources.Add from the corresponding resourcestring declarations.