$SOURCE directive

Purpose: $SOURCE will inline BCX source code as comments in the corresponding "C" code. The inlined BCX source code includes line numbers from the BCX file. This is useful as an aid in debugging problem code. $SOURCE must come before and after the BCX code that you want included in the C output.

If modules are being included using the $INCLUDE directive, adding the -m command line switch will turn on tracking of the module name and module line number and this information will be reported with the $SOURCE ouput.

Example: The following BCX code


 DIM A$

 $SOURCE
 A$ = "Example"
 IF A$ = "Example" THEN
  PRINT "Example"
 END IF
 $SOURCE

translates to C code


 int main(int argc, char *argv[])
 {
 // [4] A$ = "Example"
 strcpy(A,"Example");
 // [5] IF A$ = "Example" THEN
 if(strcmp(A,"Example"==0)
   {
 // [6] PRINT "Example"
     printf("%s\n","Example");
 // [7] END IF
   }
 return 0;   //  End of main program
 }