BCX Command Line Usage
Purpose: BC, typed on a command line, invokes the
BCX translator, with the options specified, will translate a BCX
BASIC file to a C language file.
Usage :
BC Infile[.bas] [,Options]
Parameters:
- Infile [.bas] The name of the file to be translated. The
file name can have any or no extension. If no extension is given,
BCX assumes the file ends in .BAS.
- Options Please note that the order of the command line
arguments is important. The options must follow the name of the
file to be translated.
- -d: DEFINE a constant ... ex. BC MyFile
-d:MyConst[=SomeValue]
The -d switch allows a CONST to be inserted from the command
line. If BCX is invoked like so:
bc Myfile -d:qwerty
the following would be in the resulting C file:
#define qwerty
Likewise, if BCX was invoked like so:
bc Myfile -d:qwerty=12345
the following would be in the resulting C file:
#define qwerty 12345
BCX has the ability to specify multiple defines in the command
line, for example,
bc test -D:__POCC__=400 -d:OLESUPPORT
- -e Write ERRORS to BCX.ERR file
- -f:path\filename.ext Write C output file to specified
path\filename.ext, for example,
bc myfile -f:c:\bcxfiles\newname.c
- -h Used to create the header file for use with $Project.
When the -h switch is used the file is created with the extension
of .bh for bcx header.
- -i Send Warnings and Errors to INFOBOX
- -k Kill the generated BCX generated 'C' file
- -m Enable Module Name/Line Number Reporting
- -n Suppress emission of runtime functions and link with
BCXrt.lib
- -o OUTPUT a copy of the generated C file to STDOUT
- -r Update BCX Path variable in the Windows Registry
The -r switch is for setting or updating the BCX path key
in the Windows Registry. The path is set to the folder in which
BC.EXE is located. The BCXPATH$ function relies on the registry
entry for its return value.
When the -r switch is invoked NOTHING ELSE IS
ALLOWED on the command line.
- -s Show STATUS of translation by line number
- -t:ArraySize changes the default size of the array
holding the circular buffers used for temporary storage. Note well,
ArraySize must be a power of 2, that is, 4, 8, 16, 32, 64, 128
etc.
- -u Emits _UNICODE AND UNICODE macros before any Windows
header. This is was required for full support of BCX COM functions
with when UNICODE is defined
- -w Enable WARNINGS during translation
- -x EXCLUDE Win32 Headers from the resulting C file
|
Remarks:
The following .lib files do not have to be linked explicitly
because they are emitted in the C code as #pragma's: kernel32.lib,
user32.lib, gdi32.lib, comctl32.lib, advapi32.lib, winspool.lib,
shell32.lib, ole32.lib, oleaut32.lib, uuid.lib, odbc32.lib,
odbccp32.lib, winmm.lib, comdlg32.lib, imagehlp.lib and
version.lib.
Using the BCX Translator BCX.INI file
BCX.INI provides an easy way to automatically include all your
favorite types, variables, constants, and code in all your
programs.
BCX.INI is a user defined BASIC source code file that must
reside either in the same folder as the BCX translator(BC.EXE) or
in the current folder, if it is to be used.
For example, if you create a BCX.INI that contains the
following
SUB Foo(A$)
MSGBOX A$
END SUB
then your main file could be the ONE LINE program :
Foo("Hello From BCX.INI")
If BCX can translate it, you can put it in the BCX.INI,
including CONST's, inline C, comments, directives, whatever.
As one's personal BCX.INI grows, one may want to consider using
the CONDITIONAL COMPILATION directives: $IF, ELSE, $ELSEIF, $ENDIF
to conditionally $INCLUDE other BASIC files into BCX.INI, instead
of keeping them all in BCX.INI.
$NOINI directive
BCX does not require BCX.INI to function.
By default, BCX will automatically include the contents of this
BCX.INI each time BCX is invoked. This behavior can be disabled by
placing the $NOINI directive at the
beginning of your source code file, before any code or variable
declarations.