12.1 The resource directive $R

Under WINDOWS, you can include resources in your executable or library using the {$R filename} directive. These resources can then be accessed through the standard WINDOWS API calls.

When the compiler encounters a resource directive, it just creates an entry in the unit .ppu file; it doesn’t link the resource. Only when it creates a library or executable, it looks for all the resource files for which it encountered a directive, and tries to link them in.

The default extension for resource files is .res. When the filename has as the first character an asterix (*), the compiler will replace the asterix with the name of the current unit, library or program.

Remark:This means that the asterix may only be used after a unit, library or program clause.