This topic describes the differences between FlashBASIC and BASIC.
|FlashBASIC is supported on AIX, Linux, and Windows.
|Mixing FlashBASIC and Interpreted Code
|If a mainline program is compiled with the o option, all of its subroutines must also have been produced with the FlashBASIC compiler.
|FlashBASIC code is never run when called directly from a dictionary definition.
|The FlashBASIC chain statement can be used freely to transfer control to other programs, but variables are not restored if a run statement with the i option is attempted later. This restriction is the same for FlashBASIC applications that are involved in any way with the chain statement.
| FlashBASIC currently supports calling C routines, but not assembly routines with the percent call. See the various FlashBASIC % functions.
FlashBASIC code allows a maximum of 62 parameters on an external subroutine call.
|Calls the host operating system’s random C function.
| The FlashBASIC debugger does not:
|If using the (f option, all arithmetic operations use the host machines arithmetic.
| FlashBASIC passes parameters by reference, rather than with copy-restore
(except for constants and expressions that are passed by copy). This can
cause problems in some cases.
For example: If a subroutine is called with the statement call x(y,y(10)) , where y is an array, and within that subroutine y(10) is modified, the current interpreter can restore the value differently than in the compiler.
FlashBASIC allows a maximum of 62 arguments on subroutines.
FlashBASIC does not complain when the number of parameters passed does not equal the number of parameters contained in the subroutine. However, this is not supported and can cause subsequent program failure and data corruption.
|Array bounds checking is absent in FlashBASIC by default, but can be invoked with the b option when compiling. Use this feature with caution, because it can destroy other program data due to application bugs.
|FlashBASIC and non-FlashBASIC do not share the same named common space.
|Named Common variables
|Named Common variables are not shared between FlashBASIC and BASIC programs run during the same logon session.
| In FlashBASIC, variables are assigned a data type at assignment
time: string or numeric. If the value assigned to the variable is
a non-numeric literal, only the string flag is set. If the value assigned
is a numeric literal, both flags are set. If any numeric operation
is performed successfully upon the variable, the string flag is set
off and the numeric flag is set on.
When two variables are compared, their type flags are checked for compatibility. If both fields have their string flags set, the computer performs a string compare ("001" # "1"). If both fields have their numeric flags set and neither has a string flag set, a numeric compare ("001" = 1) is performed.It is important to note that this behavior can be controlled by the use of "+0" to normalize numeric variables and force numeric compares; while ":' '" concatenates a space, forcing the numeric flag off and forcing string compares.
|Retrieval Lock error messages
| When running a BASIC program that opens a Q-pointer that points
to an md with a retrieval lock, if the user’s key does not match the
retrieval lock key:
For BASIC: The system displays the message access protected.For FlashBASIC: The system displays fn.q is not a file name.
|If a readt is attempted without a device attached, BASIC takes the else clause with system(0) = 1, but FlashBASIC attempts the read.
|If a subroutine encounters an abort statement, processing returns to the calling program.
|open statements (Windows Only)
| For BASIC: The open statement try
to open the requested file in the VME.
For FlashBASIC: The open statement will first try to open the requested file in the FSI, then try to open the requested file in the VME.
|Invalid match patterns may produce different results between FlashBASIC and BASIC programs.
|Assignment statements in Flash-compiled BASIC programs do not interrogate the values assigned to the variables. As a result, "Variable has not been assigned to value: zero used" messages will not be reported on the same lines as they would have been in a non-Flash-compiled program.
|Using pick functions as parameters in % function calls
| For BASIC: Supported
For FlashBASIC: Not Supported
|Shared memory segment
|Files names greater than 55 characters in length and file and program names with a combined length greater than 62 characters are not uniquely identifiable in a shared memory segment. Additionally, if a program name is not the same in both attribute 0 and attribute 4 of a cataloged subroutine, performance will be degraded.
|Number of concatenations allowed in a single statement.
|The maximum number of concatenations allowed in a single statement when Flash-compiling is 253.
|return to statement
|If the return to statement is used incorrectly in FlashBASIC it will be treated as a return. In non-Flash, it will abort.
| Some user exits may function differently in FlashBASIC vs. non-Flash. For example:
The u8f user exit will produce different results in FlashBASIC and non-Flash.
Using precision in Flash-compiled and non-Flash-compiled programs