-
- Line numbers are not supported in BCX.
-
- BCX(and C/C++) uses 1 for TRUE and 0 for
FALSE but QBASIC 4.5 uses -1 for TRUE and
0 for FALSE.
- BCX's built-in language variable, subroutine and function
procedure, type etc. names are not case-sensitive. User created
variable, subroutine and function procedure, type etc. names 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 declares for
you.
- 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 sized large enough to include this terminator. For
example if a string contains 15 characters then it must be sized to
at least 16 bytes.
- String variables and functions default to a minimum 2048
bytes each.
- Dynamically declared strings are limited only by available
memory. That means, for example, that you can easily size a
string such as:
DIM A$ * 5000000
which would declare a five megabyte string variable!
- The default variable data type in BCX is INTEGER. In
QBASIC, the default data type is 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.
- BCX arrays contain one less storage location than
QBASIC. If a BCX array is declared 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].
- In BCX, brackets
[ ]
not parentheses
( )
are used for delimiting arrays.
-
- Some other BASIC dialects only use the plus sign(+) to
concatenate strings. In BCX, string concatenation may use the +
symbol or 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.
-
- Colon ":" separated compound statements are
supported,
Example:
CLS : LOCATE 10,10,1 : ? "hello"
- The "?" operator is allowed instead of the PRINT
statement.
- Variables declared inside a SUB or FUNCTION are LOCAL
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
-
- In some other BASIC dialects, a FUNCTION
procedure uses the name of the FUNCTION for the
right side of the return statement as, for example, the "Test" name
in this code
Function Test() As String
Test = "OK"
End Function
BCX, instead, uses the FUNCTION or the
RETURN keyword as the right side of the return
statement as shown below; as this
FUNCTION Test() As STRING
FUNCTION = "OK"
END FUNCTION
or as this;
FUNCTION Test() As STRING
RETURN "OK"
END FUNCTION