Omron SYSMAC C200H-ASC02 Operation Manual page 59

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

Advertisement

BASIC Language
RANDOM Statement
READ Statement
REM Statement
^^^^
Indicates the output in exponential format (E+nn). Add this character
after #.
""
is output before the numeric value if the specified number of digits is
too great.
If the port number is omitted, port 1 is assumed for the PRINT USING state-
ment and port 2 for the LPRINT USING statement.
The LPRINT statement outputs data under control of the peripheral device
connected to port 2 irrespective of the OPEN statement directives.
Purpose:
To reseed the random number generator
Format:
RANDOM [<exp>]
<exp> is a single or double-precision integer that is used as the
random number seed.
Example:
RANDOM 5649
Remarks:
The value of <exp> should be from -32768 to 32767. If the expression is
omitted, a message requesting the random number seed will be displayed.
If the random number generator is not reseeded, the RND function returns
the same sequence of random numbers each time the program is run. To
change the sequence of random numbers each time the program is RUN,
place a RANDOM statement at the beginning of the program and change the
seed with each RUN.
For more information, refer to the explanation of RND.
Purpose:
To read values from a DATA statement and assign them to the
specified variables
Format:
READ <list of var>
Example:
READ A,B$
Remarks:
A read statement must always be used in conjunction with a DATA state-
ment. READ statements assign variables to DATA statement values on a
one-to-one basis. READ statement variables may be numeric or string, and
the values read must be the same type as the corresponding variable. If they
do not agree, a syntax error will occur.
A single READ statement may access one or more DATA statements (they
will be accessed in order), or several READ statements may access the
same DATA statement.
If the number of variables in <list of var> exceeds the number of elements in
the DATA statement(s), an error message will be displayed. If the number of
variables specified is fewer than the number of elements in the DATA state-
ment(s), subsequent READ statements will begin reading data at the first
unread element. If there are no subsequent READ statements, the extra data
is ignored.
To reread DATA statements from the beginning, use the RESTORE state-
ment.
Purpose:
To insert non-executable comments in a program
Section 4-2
49

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents