General restrictions, Differences between a-b vbasic and visual basic – Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 148

Advertising
background image

A–B

L

Appendix

L–1

Differences Between
A-B VBASIC and Visual BASIC

This document describes the differences between Allen-Bradley VBASIC
and Microsoft Visual BASIC. It first lists general characteristics unique to
A-B VBASIC, and then provides additional information on keywords
supported by A-B VBASIC.

In this discussion, all references to “VBDOS” refer to Visual Basic for DOS.
Also any references to “A-B VBASIC” refers to A-B VBASIC, used for
programming a DH5 terminal. These references are for our convenience and
do not refer to any trademark. Any time the “VBDOS manual” is mentioned,
we are referring to the Visual Basic Reference Manual for MS–DOS. To
some extent, most comments here also apply to QuickBASIC V4.5,
Microsoft PDS 7.1, and QBASIC versions of the BASIC language.

1. All arrays must be DIMensioned.

2. STATIC and DYNAMIC arrays and metacommands do not apply in A-B

VBASIC.

3. Periods are not allowed within a variable name, unless that variable is part

of a user defined TYPE.

4. The entire A-B VBASIC program (i.e. the input to LXB), must reside in

one file.

5. The exponentiation operator (^), may have a positive integer exponent

only.

6. “@” AND “[“ AND “]” are invalid outside literals.

7. Some of the general syntax implemented by some BASIC compilers is

not allowed. The following syntax may be familiar to some users but is
not mentioned in the VBDOS manual and is not recognized by the A-B
VBASIC cross–compiler (LXB):

[ and ] instead of ( and ) to delimit array subscripts.

? as a synonym for PRINT.

PRINT#, INPUT#, and WRITE# without a space preceding #.

8. DOUBLE precision floating–point data

A-B VBASIC does not support double precision real arithmetic.
Specifically, the interpreter in the terminal is not programmed to do
DOUBLE math, and may or may not generate a “Double not supported”
error message whenever it encounters anything which has to do with
DOUBLE operations, depending on firmware version. However, the A-B
VBASIC cross–compiler accepts the following DOUBLE–related syntax
in most respects, and you may not see an error message until the program
is downloaded into the terminal and executed:

DEFDBL

General Restrictions

Advertising
This manual is related to the following products: