Denso RC5 Specifications Page 190

  • Download
  • Add to my manuals
  • Print
  • Page
    / 692
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 189
8-8
[ 3 ] Array Declaration
This is a declaration statement for an array. An array can be created for all
types except for an I/O variable by adding a postposition to a variable name.
However, an array cannot be initialized together with the declaration.
The subscript of an array must be 0 or more. The array can be up to 3
dimensions.
The upper limit of the total number of elements for an array is 32767.
Array Declaration
Type Command Example
Array declaration DIM DIM AA (10,10)
Example of array declaration:
DIM CC (3,3,3) AS INTEGER 'Sets CC to 3-dimensional array of an
integer
'type.
The above example can be expressed as follows by the use of a DEFINT
command.
DEFINT CC (3,3,3) 'Sets CC to 3-dimensional array of an
integer
'type.
Note: Difference between DEF??? statement and DIM statement
A DIM statement can be used for more than just an array.
For example, instead of
DEFINT CC,
Express as follows.
DIM CC AS INTEGER
Since it cannot be initialized at the same time as the type
declaration, a DIM statement is more universal than a DEF???
statement. For example, the following expression cannot be
created using a DIM statement.
DEFINT CC = 1 'Declares CC as an integer type and sets
the initial value to 1.
If it is not initialized together with the declaration, all types of
arrays can be handled in the same manner. Therefore, using a
DIM statement is recommended.
[ 4 ] I/O Variable Declaration
A variable name corresponds to a specific I/O port.
I/O Variable Declaration
Type Command Example
I/O variable declaration DEFIO
DEFIO PORT =
BYTE,104
Page view 189
1 2 ... 185 186 187 188 189 190 191 192 193 194 195 ... 691 692

Comments to this Manuals

No comments