Omron SYSMAC C200H-ASC02 Operation Manual page 44

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

BASIC Language
DEF/INT/SNG/DBL/STR
Statement
DEF USER Statement
DIM Statement
34
This statement may define either numeric or string functions. If a type is spe-
cified in the function name, the value of the expression is forced to that type
before it is returned to the calling statement.
If a type is specified in the function name and the argument type does not
match, an error will occur.
Purpose:
To declare variable types as integer, single-precision, double-
precision, or string
Format:
DEF <type><letter>[-<letter>]
[<letter>[-<letter>]]...
<type> is INT, SNG, DBL, or STR
Remarks:
Any variable names beginning with the <letter(s)> listed will automatically be
assigned to the specified variable type.
The "", "!", and "$" declaration characters take precedence over a DEF
<type> statement.
If no type declaration statements are encountered, BASIC assumes all vari-
ables without declaration characters to be single-precision variables.
Example:
DEFINT A-D, X
All variables beginning with A, B, C, D, and X will be integer variables.
Purpose:
To specify the starting address of an assembly language subrou-
tine that will be called via the USR function
Format:
DEF USR [<digit>] = <offset>
<digit> is an integer from 0 to 9. The digit corresponds to the
USR routine number whose address is being specified. If <digit>
is omitted, DEF USR0 is assumed.
<offset> is the starting address of the USR routine.
Remarks:
Any number of DEF USR statements may appear in a program to redefine
subroutine starting addresses, thus allowing access to as many subroutines
as necessary.
Program Example:
100
DEF USR1=&H2100
110
POKE &H2100, &H39
120
A=USR1 (A)
130
PRINT A
Purpose:
To specify the maximum values for array variable subscripts and
allocate storage accordingly
Format:
DIM <variable>(<subscripts>)
[ ,<variable>(<subscripts>)]...
<variable> is a legal variable name.
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents