Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What this phrase {$R *.dfm} in the code editor?

Tags:

delphi

pascal

What this phrase {$R *.dfm} in the code editor?

I tried This :

//{$R *.dfm}
like image 436
Djemoui Avatar asked Feb 19 '19 21:02

Djemoui


1 Answers

You'll want to keep that in there. The $R directive links a resource file into the EXE. The *.dfm means "the file that has the same filename as this .pas file, but with a .dfm extension instead."

What it does is makes sure that when the compiler builds the project, that your form data ends up compiled in. Without this, when your code tries to load up the form, it won't be able to find the form data and it will crash.

like image 126
Mason Wheeler Avatar answered Nov 19 '22 11:11

Mason Wheeler