Rockwell Automation 2708-NBD VBASIC Language Development Kit User Manual

Page 53

Advertising
background image

A-B VBASIC and Visual BASIC

Appendix B

Differences Between

B–5

DECLARE FUNCTION GetTime$()

DECLARE SUB SetTime$()

The generic name for declaring a procedure’s name and its parameters is
“prototyping”. LXB.EXE creates a prototype for every procedure
encountered whether by the DECLARE statement, the FUNCTION
statement, or the SUB statement.

To allow the user to include files of DECLARE statements without regard to
whether the code for each procedure is also included, LXB will not issue an
error if a procedure is DECLAREd but never defined. Multiple DECLAREs
of the same procedure are permitted but should be identical. Use of a
procedure without its definition will cause an error. Be aware that the
various editors used by Microsoft in their BASICs (QB, QBX, VBDOS,
QBASIC, etc.) usually sort subroutines into alphabetic sequence, which can
ruin any arrangements you may have made to eliminate DECLARE
statements. If prototypes are not present in the source when VBDOS runs a
program, it simply creates them. However, if they are missing when the LIB
compiler is invoked, a compiler error results.

DEFINT letterrange[,letterrange]...

DEFSNG letterrange[,letterrange]...

(DEFDBL letterrange[,letterrange]...)

No longer supported

DEFLNG letterrange[,letterrange]...

DEFSTR letterrange[,letterrange]...

Defines the default type of all variables beginning with the indicated letter
range as either integer, single precision, double precision, long integer, or
string. A-B VBASIC converts any double precision operations to single
precision, so see the details in the “General Restrictions” section. Generally
it is best to define all variables with the following command at the very
beginning of the program, so that all math operations use the fastest form of
arithmetic processing. Variables which need to be floating point can then be
explicitly typed by using the ! or # trailer.

DEFINT A–Z
X! = 123.45

’Overrides DEFINT statement!

DIM [SHARED] variable[(subscripts)][AS type]...

Declares a variable and allocates storage space. VBDOS will not allow a
fixed length string (nor an array of them) to be passed to a procedure, neither
will A-B VBASIC. So, as an alternative, use TYPE..END TYPE to define a
variable or array of fixed length strings, and pass it instead.

Advertising