$PROJECT directive

When using $PROJECT no runtime code is generated but the following #pragma is added:


 IF Use_Pelles THEN
 #pragma comment(lib,"bcxRT.lib")
 ELSE
 #pragma lib <bcxRT.lib>
 END IF

bcxRT.lib is the runtime functions library for BCX, it must be placed in the compilers /lib folder.


 Syntax:
 
 $PROJECT "mainfile.bas"

 Parameters:

  • mainfile.bas This is in anticipation of creating a BCX Project file (file.bpj) and a make program(bcmake.exe) to automatically recompile only files that have changed and automatically link files in a project. At this time the parameter does nothing. In the future it will denote the 'main' program in a project and which will also be the name for the .bpj(project file).

Remarks: The $PROJECT directive must be placed at the top of the source file and before the $PELLES directive..

The bc.exe command line flag -n can be used instead of the $PROJECT directive.

Use of $project will cause a .h file of the same name as the source file to be emitted with the prototypes which are contained in the source file. This file is deleted if it contains no prototypes. To use project and multi-file projects global scope variables should use SHARED instead of GLOBAL in the files in which they are declared and referenced in other source files with the EXTERN keyword.

One of the problems with computer programs, is that they tend to grow larger and larger, causing increasingly longer and longer compilation and linking time. The first time a program we write reaches this state, is normally to look for a different way to manage our projects.

It is at this point where we start thinking about break out the source code into smaller units of related files, that can be managed with a separate makefile, possibly by a different programmer(for a multi-programmer project).