I have a unit which has a resourcestring in its implementation section. How can I get the resourcestring's identifier in another unit?
unit Unit2;
interface
implementation
resourcestring
SampleStr = 'Sample';
end.
If it is available in the interface section, I can write this:
PResStringRec(@SampleStr).Identifier
Anything declared in a unit's
implementationsection is private to the unit. It CANNOT be accessed directly from another unit. So, you will have to either:move the
resourcestringto theinterfacesection:leave the
resourcestringin theimplementationsection, and declare a function in theinterfacesection to return the identifier: