$INCLUDE directive

Purpose: $INCLUDE merges a file into the calling BCX file at translation time. $INCLUDE can be used anywhere in a program and the file will be inserted at the position of the $INCLUDE directive.


 Syntax 1:

 $INCLUDE "Path\Filename" 

 Parameters:

  • "Path\Filename" is the path\folder to search for the file to be included.

Example:


 $INCLUDE "C:\bcx\include\file.bas"



 Syntax 2:

 $INCLUDE "Filename" 

 Parameters:

  • "Filename" will instruct the BCX translator to search in the current working folder for the file to be included.

Example:


 $INCLUDE "file.bas"



 Syntax 3:

 $INCLUDE <Filename> 

 Parameters:

  • <Filename> When Filename is enclosed in chevrons, the BCX translator will check the BCXLIB environmental variable for the folder path which to be used to check for the existence of the file to be included. Using this syntax implies that the BCXLIB operating system system environment variable has been set to point to a folder holding files to be included. This feature eliminates the need to provide the complete path if the file is in the default include folder pointed at by BCXLIB. The path set by BCXLIB must include the trailing backslash, for example,
    
     SET BCXLIB = C:\bcx\include\
    
    

Example:


 $INCLUDE <file.bas>

Remarks:

BCX $INCLUDE files can be nested. This means that a file called with $INCLUDE can call other files to included.

#INCLUDE directive

Purpose: #INCLUDE merges a C language header file into the translated C source at compile time. You may add #INCLUDE statements anywhere in your BASIC source code. BCX watches for these and adds them to the top of the generated "C" file along with the other header files.


 Syntax 1:

 #INCLUDE "Path\Filename" 

 Parameters:

  • "Path\Filename" is the path\folder to search for the file to be included.

 Syntax 2:

 #INCLUDE "Filename" 

 Parameters:

  • "Filename" will instruct the compiler to search in the current working folder for the file to be included.

Example:


 $INCLUDE "c_header.h";


 Syntax 3:

 #INCLUDE <Filename> 

 Parameters:

  • <Filename> will instruct the compiler to search in the default include folder of the C compiler for the file to be included.

Example:


 $INCLUDE <c_header.h>