10
■
Defining and declaring user-defined functions more easily
BHT-BASIC 3.5 has added FUNCTION…END FUNCTION, SUB...END SUB, and DECLARE
statements. With the former two, you may easily define your own functions—FUNCTION and
SUB. With the latter one, you may declare FUNCTION and SUB functions which are defined
in any other source files.
■
Distinction between local variables and global variables
(defined by PRIVATE and GLOBAL statements)
BHT-BASIC 3.5 makes distinction between local variables and global variables to restrict the
access to the variables.
Both local variables and global variables may be defined for work variables and register vari-
ables. Local variables can only be accessed by any routine in the file where that variable is
defined. Global variables can be accessed by any routine in a program.
However, variables used without declaration inside
FUNCTION or SUB function are regarded
as local variables and can be accessed only within that function.
Since local variables are restricted in access, you can define them with the same name in dif-
ferent files.
■
Defining constants
BHT-BASIC 3.5 can define constants.
Komentarze do niniejszej Instrukcji