37
90
GOTO
150
100
110
T = T + TIME
120
RETURN
130
{stuff}
GOTO Statement
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>.
IF...THEN Statement
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.
INPUT 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.
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 ...