-
BCX(and C/C++) uses 1 for TRUE and 0 for FALSE but QBASIC 4.5 uses
-1 for TRUE and 0 for FALSE.
-
Line numbers are not supported in BCX.
- BCX variables, subroutine and function procedures, and User Defined Types
are Case Sensitive
This is going to drive longtime BASIC programmers crazy, but it was necessary
in order to write BCX. Hopefully, this will not discourage you from trying BCX
as it will not really take too long to get used to it. Most Win32 API code that
you will want or need to use is also case sensitive to all other Windows languages
C, C++, Fortran, Prolog, PowerBasic, Visual Basic and so on.
- All global and local variables(scalar and array) MUST be declared
using a
DIM
, GLOBAL
, LOCAL
or other declaration statement, with the only possible exception being those variables
used as file handles. File handle variables are special C variables that BCX
dimensions for you.
- QBASIC syle file handles using the #number syntax are not supported in BCX.
- All global variable names must be unique. That means, you cannot have a global
variable named A$ and another named A%. You could, however have a global variable
named A$ and another global variable named a$ because BCX is case sensitive.
- BCX uses ASCIIZ strings which are terminated with an ASCII NULL terminator
character to mark the end of the string. A string must be dimensioned to a size
large enough to include this terminator. For example if a string contains 15
characters then it must be dimensioned to at least 16 bytes.
- String variables and functions default to a minimum 2048 bytes each.
- Dynamically dimensioned strings are limited only by available memory.
That means, for example, that you can easily dimension a string such as:
DIM A$ * 5000000
which would dimension a five megabyte string variable!
- The default variable type is integer instead of single.
This just makes sense since most code is loop and test related and using integers
for those types of operations is significantly faster and produces smaller progams.
Use floating point variables only where they are necessary.
- In BCX, if an array is dimensioned as
DIM
Array$[
30
]
there will be 30 storage locations for data with the index numbered from array$[0] to array$[29].
This differs from QBASIC which will allocate 31 storage locations
with the index numbered from array$[0] to array$[30].
- Brackets, not parentheses, are used for delimiting arrays.
DIM A%[100,10]
Again, note well that brackets
[ ]
are used, not parentheses
( )
- Some other BASIC dialects use the plus sign(+) to concatenate strings.
In BCX, string concatenation may use the + symbol as long as the
+ symbol is followed by either a string literal or a variable
contain appended with the $ data type symbol. Otherwise
string concatenation MUST be performed using the ampersand
(&) symbol.
You can also concatenate strings together using BCX's
JOIN$
or
CONCAT$
functions.
- String literals may not be modified.
A program that attempts to modify a string literal has undefined
behavior.
-
PRINT
and
FPRINT
recognize comma separated variables and constants,
but do not handle expressions very well, so don't do it.
- Colon ":" separated compound statements are supported,
Example:
CLS : LOCATE 10,10,1 : ? "hello"
- The "?" operator is allowed instead of the
PRINT
statement.
- Variables DIMensioned inside SUB's and FUNCTION's are LOCAL
An Example:
PRINT "Hello from 1"
CALL Mysub
PRINT "Hello from 2"
SUB MySub
DIM A$ ' a local string
DIM B![200] ' a local array of SINGLES
DIM I% ' a local integer
A$ = "Hello From The Sub"
PRINT A$
FOR I% = 0 TO 200
B![I%] = I%
NEXT
END SUB