Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in interface and implementation section having {$R *.DFM} directive

Tags:

delphi

Difference between having {$R *.DFM} directive in interface and implementation section?

what if i have {$R *.DFM} in interface?

interface
{$R *.DFM}

what if i have {$R *.DFM} in implementation?

implementation
{$R *.DFM}
like image 700
Anto Raja Prakash Avatar asked Oct 21 '22 04:10

Anto Raja Prakash


1 Answers

It shouldn't make any difference. That instruction ensure that the DFM resource associated with that unit's form gets linked to your executable. All units have access to all resources in the program, so the location of the linking instruction has no effect on the visibility of the resource.

That instruction is placed by the IDE. The IDE can act strangely if you move parts of your code that it's responsible for, so I don't recommend moving the $R command, even if the compiler accepts it anywhere. Leave it wherever you found it.

like image 81
Rob Kennedy Avatar answered Oct 23 '22 01:10

Rob Kennedy