Extracting Resource String
From RAD Studio
Go Up to Refactoring Applications Index
Editing Delphi code in the Code Editor, you can use the Refactor > Extract Resource String menu command to convert the selected quoted string to the resource string.
To convert a string constant to a resource string
- In the Code Editor, click the quoted string to be converted to a resource string, for example, in the following code, click inside the
procedure foo; begin writeLn('Hello World'); end;
- Choose Refactor > Extract Resource String menu command. The Extract Resource String dialog box opens.
- Enter a name for the resource string or accept the suggested name (the
Str, followed by the string).
- Click OK.
The created resource string is added into the
resourcestringsection. If there is no
resourcestringsection, the refactoring engine creates the
resourcestringsection in the implementation section of your code. The original string is replaced with the new resource string name:
resourcestring strHelloWorld = 'Hello World'; procedure foo; begin writeLn(StrHelloWorld); end.