Dim ( Defines The Array ) - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
DIM
Instruction
• Specifies the size of a dimension and assigns a memory area necessary for the array.
DIM
Syntax
name (numeric expression [, numeric expression] ...) ]
array variable name
numeric expression
DIM A(2, 2)
Examples
A(0, 0)
A(0, 1)
A(0, 2)
• The DIM instruction specifies the size of an array variable and assigns a memory area
Description
necessary for the array.
• The following arrays can be defined:
• <numeric expression> may be specified up to 32767. An insufficient memory occurs if too
large memory area is assigned.
• When using an array, a "Subscript out of range" error occurs if the index of the array
variable name is larger than the value of <numeric expression> specified by the DIM
instruction.
• The minimum value of <numeric expression> is 0.
• If an array variable name, which is not specified by the DIM instruction, is used, 10 is
assumed for the minimum value of its index.
11 - 58
DIMension
array variable name (numeric expression [, numeric expression] ...) [, array variable
A(1, 0)
A(2, 0)
A(1, 1)
A(2, 1)
A(1, 2)
A(2, 2)
A(n)
• • • •
A%(n)
• • • •
A!(n)
• • • •
A#(n)
• • • •
A$(n)
• • • •
In some instructions of AD51H-BASIC, there are some that do not correspond to
the implicit array declarations as shown above.
It is recommended that arrays be used after declaring variables by the DIM instruction.
• • • •
Specify the name of a variable used as an array.
• • • •
Specify the size of the array specified by the array
variable name.
• • • •
Indicates a two dimensional numeric value array.
Numeric value array
Integer array
Single precision array
Double precision array
Character array
MELSEC-Q
11 - 58

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents