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
implementation
section is private to the unit. It CANNOT be accessed directly from another unit. So, you will have to either:move the
resourcestring
to theinterface
section:leave the
resourcestring
in theimplementation
section, and declare a function in theinterface
section to return the identifier: