![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429045.webp)
35
<subscripts> are the maximum number of elements for each di-
mension of the array. There can be up to 255 subscripts but the
maximum size of the array cannot exceed the amount of memory
available.
Example:
DIM A (10,20), B$(30)
Remarks:
If an array variable name is used without a DIM statement, the maximum val-
ue of the array’s subscript(s) is assumed to be 10. If a subscript is used that
is greater than the maximum specified, an error will occur. The minimum val-
ue for a subscript is zero.
The DIM statement initializes all the elements of numeric arrays to zero.
String array elements are initialized to NULL.
END Statement
Purpose:
To terminate program execution, close all files, and return to
command level
Format: END
Remarks:
END statements may be placed anywhere in the program to terminate ex-
ecution. Unlike the STOP statement, END closes all open files or devices. An
END statement at the end of the program is optional. BASIC always returns
to command level after an END is executed.
ERROR Statement
Purpose:
To simulate the occurrence of an error, or to allow error codes to
be defined by the user
Format: ERROR
<n>
<n> is the error code to be simulated.
Remarks:
Error code numbers 1 to 255 are predefined and reserved by BASIC. Higher
numbers can be used for user-defined error code messages. User-defined
error codes can be used together with the ON ERROR GOTO statement to
branch the program to an error handling routine.
When the ERROR statement is executed without an accompanying ON ER-
ROR GOTO statement, the error message corresponding to the specified
error number is output and program execution is stopped. The message UN-
DEFINED ERROR is displayed if an undefined error occurs.
The error number is assigned to the variable ERR and the line number where
the error occurred is assigned to the variable ERL.
FOR and NEXT Statements
Purpose:
To allow a series of instructions to be performed in a loop a given
number of times
Format:
For <var>=<x> TO <y> [STEP<z>]
<x>, <y>, and <z> are numeric expressions.
Example:
100 FOR Y = base TO 10 STEP 2
110 NEXT Y
Remarks:
BASIC Language
Section 4-2
Summary of Contents for SYSMAC C200H-ASC02
Page 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Page 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Page 122: ...Appendix B Specifications 115 130 35 100 5 ...
Page 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...