beautypg.com

Variable names and declaration characters, Array variables, Expression and operators – Argox PA-20 Basic Programming Manual User Manual

Page 10: 3 expression and operators

background image

PT-Basic Programming Manual Ver. 1.00

9/143

2.2.1

Variable Names and Declaration Characters

The following are the rules to declare variable names and

characters:
 A variable name must be begun with a letter.
 The remaining characters can be letters, numbers, or

underscores.

 The last character can be one of these declaration characters:

% (Integer)

: 4 bytes (- 2147483648 to 2147483647)

! (Real number) : 8 bytes

$ (String)

: 255 bytes

 Variable name cannot be any BASIC reserved words.
 Only 3 types of variable are supported.
 Variable names are case ( upper or lower case ) dependent.

2.2.2

Array Variables

An array is a group or table of values referenced by the same

variable name. Each element in an array is referenced by an array

variable that is subscripted with an integer or an integer

expression.

Each element in an array is referenced by an array variable that is

subscripted with an integer or an integer expression. In PT-Basic,

the maximum number of dimensions for an array is 2.

For example:

 A$(8)

„one dimension array

 Str%(2,5)

„two dimension array

 DIM A%(23)

„declares an integer array with 23

elements.

 DIM Str$(60)

„declares a string array with 60 elements.

2.3 Expression and Operators

An expression may be a string or numeric constant, or a variable, or it may

be a combination of constants and variables with operators to produce a

string value.

Operators perform mathematical or logical operations.