Variable names, Variable types – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 21

Advertising
background image

Publication 1746-RM001A-US-P

Data Types 2-5

Variable Names

Variables may represent either numeric values or strings. Variable names can only
be eight characters long. The module compares the first, last, and number of
characters in a variable name with the first, last, and number of characters in other
variable names to determine if it is a unique variable name. The characters allowed
in a variable name are letters, numbers, and the decimal point. Special type
declaration characters are also allowed.

A variable can be a letter (for example

A

,

X

, or

I

) followed by a:

single-dimension expression, (example:

J(4), G(A+6), I(10*SIN(X)

)

number followed by a single-dimension expression (example:

A1(8),

P7(10*SIN(X)), W8(A + C)

)

number (0 to 9) or letter (example:

AA, AC, XX, A1, X3, G8

) except for the

following combinations:

CR, DO, IE, IF, IP, ON, PI, SP, TO, UI, UO

Variable Types

Type declaration characters indicate what a variable represents. The following type
declaration character is recognized:

The only other legal variable type is a floating-point variable. Floating-point
variables do not require a type declaration.

IMPORTANT

Reserved words (words already used in BASIC functions or
statements) cannot be used as variable names.

Character

Variable Type

$

String variable

Advertising