33
40
GOTO 40
100
IF LOC(2)<>0 THEN A$=INPUT$ (LOC(2), #2)
110
RETURN
DATA Statement
Purpose:
Defines numeric and character constants to be specified in a
subsequent READ statement
Format: DATA
<constant>[,<constant>]...
<constant> may be a numeric constant in any format; i.e., fixed-
point, floating-point, or integer. <constant> can also be a charac-
ter string. Quotation marks are necessary only if the constant
contains comas, colons, or spaces.
Example:
DATA CF, 10, 2.5, “A.:B”
Remarks:
Any number of DATA statements can be used in a program. READ state-
ments access DATA statements in order (by line number). The data con-
tained therein may be thought of as one continuous list of items, regardless
of how many items are on a line or where the lines are placed in the pro-
gram.
DATA statements are non-executable and can be placed anywhere in a pro-
gram. A data statement can contain as many constants as will fit on one line
(separated by comas).
The variable type given in the READ statement must agree with the corre-
sponding constant in the DATA statement.
DATA statements may be reread from the beginning by use of the
RESTORE statement.
No comment (with “:” or “’”) can be written after the DATA statement.
DEF FN statement
Purpose:
To define and name a function written by the user
Format:
DEF FN<name>[(<arg1>[,<arg2>]...)] = <def>
<name>, which must be a legal variable name, is the name of
the function.
<argn> is a list of variable names called parameters that will be
replaced with values calculated when the function is called. The
items in the list are separated by comas.
<def> is an expression that performs the operation of the func-
tion and is limited to one line.
Example:
DEF FNA (X, Y, Z) = SQR(X^2 + Y^2 + Z^2)
Remarks:
A user function must be defined with the DEF FN statement before it can be
called. To call a user function once it has been defined, append FN to the
assigned name of the function and set it equal to some variable.
distance = FNA(X,5,5)
Variable names that appear in the defining expression serve only to define
the function; they do not affect program variables that have the same name.
The variables in the parameter list represent, on a one-to-one basis, the
argument variables or values that will be given in the function call.
BASIC Language
Section 4-2
Содержание SYSMAC C200H-ASC02
Страница 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Страница 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Страница 122: ...Appendix B Specifications 115 130 35 100 5 ...
Страница 167: ...Cat No W165 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor ...
Страница 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...