0

The situation is:

unit xyz;

interface

resourcestring
  RSabc= 'my text here';

implementation

end.

I want to get resource string name from above resourcestring. I want to write function which will take RSabc or Resource string ID as input parameter and return me 'RSabc' as return value.

Andrew T.
  • 2,088
  • 1
  • 20
  • 42
user4916191
  • 125
  • 9
  • You cant. As far as I know there are no RTTI generated for resource strings – Jens Borrisholt May 20 '15 at 04:48
  • See [Delphi How can i find a resource name from resourcestring unit](http://stackoverflow.com/q/29145598/576719). – LU RD May 20 '15 at 05:12
  • Hello Rob, Your comment clear my doubt to some extend but the my problem is little different, I have few hundred of resource string declared in application and there values are externalized I have string declared in = pair in some text file. If resourcestrings are fetched and if it is found in the text file. I need to override that resourcestring value with the value form test file. – user4916191 May 20 '15 at 12:19
  • What's stopping you from doing that? What you've described doesn't make this question different from the duplicate. It simply means you need to add an extra step after you recognize the resource name. That doesn't change the fact that Delphi doesn't let you look up resource strings by name. – Rob Kennedy May 20 '15 at 13:13
  • Thanks Rob once again, I am checking on the approach you suggested. I was little worried about the performance and just want to avoid overhead of manually building mapping of resource string name and its identifier for further reference. Every time new string added to text file same I need to add it to above mapping for further reference. That's why I was searching for some build in method to resolve this issue. So that I can directly get resource string name and same I can look-up in text file for its new value. – user4916191 May 20 '15 at 13:34

0 Answers0