Omron SYSMAC C200H-ASC02 Operation Manual page 47

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

Advertisement

BASIC Language
GOTO Statement
IF...THEN Statement
INPUT Statement
90
GOTO 150
100
110
T = T + TIME
120
RETURN
130
{stuff}
Purpose:
To unconditionally branch program execution to the specified line
number
Format:
GOTO <line>
<line> is a valid line number.
Remarks:
If <line> is a non-executable statement, execution will proceed at the first
executable statement encountered after <line>.
Purpose:
To control program flow based on the results returned by an
arithmetic or logical expression
Format:
IF <expression> [ , ] THEN <statement(s)> or <line>
[ELSE <statement(s)> or <line>]
IF <expression> [ , ] GOTO <line>
[[ , ] ELSE <statement(s)> or <line>]
Example:
IF B=10 THEN PRINT "hello" ELSE 500
Remarks:
If the result of <expression> is not zero, the THEN or GOTO clause will be
executed (GOTO is always followed by a line number). THEN may be fol-
lowed by either a line number for branching or one or more statements to be
executed.
If the result of <expression> is zero, the THEN or GOTO clause will be ig-
nored and the ELSE clause, if present, will be executed. IF there is no ELSE
clause, execution will continue with the next executable statement.
Purpose:
To allow input from the keyboard during program execution
Format:
INPUT [;] [#<port>][<"prompt">;]<variable>
[,<variable>]...
#<port> is the port number (1 or 2).
<"prompt"> is a message that will be displayed when the INPUT
statement is executed.
Examples: INPUT "DATA" : A$
INPUT #2, "DATA" , A$, B$
Remarks:
When an INPUT statement is executed, program execution pauses and a
question mark is displayed to indicate the program is waiting for data. If
<"prompt"> is included, the string is displayed before the question mark. The
program will not continue execution until the user has entered the required
data.
Section 4-2
37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents