Resource File Compiling

We begin with a plain text file and compile it into a binary format that can be utilized by PowerBASIC. The plain text file is termed a Resource Script and these are stored with a .RC file extension. A Resource Compiler is then used to create a binary (.RES) file.

The PowerBASIC IDE can be loaded with a Resource Script (.RC file) and compile the script into PowerBASIC resource file format. This is performed using the regular Compile Current File button or the RUN | Compile File menu item.

Once a .RES file has been created, it can be embedded into an application EXE or DLL simply by using a #RESOURCE metastatement. During compilation, PowerBASIC automatically embeds the resource file to create a single file that contains compiled code and resources.

#RESOURCE RES, "DIALOGS.RES"

Previous version of PowerBASIC also generated a .PBR (PowerBASIC resource file) when compiling an .RC file. The #RESOURCE metastatement still supports this format. You can enable .PBR generation for backward compatibility when compilng an .RC file by selecting the "Create a .PBR when compiling .RC files" option on the compiler options tab.

See Also

What is a Resource File?

Resource Editors

Resource Scripts

#RESOURCE metastatement