40
Remarks:
The KEY ON statement enables an interrupt invoked by keyboard input. After
this statement has been executed, an interrupt will be triggered each time the
specified key is input. Program execution then branches to an interrupt service
routine defined with the ON KEY GOTO or ON KEY GOSUB statements.
The KEY OFF statement disables the interrupt; key input will no longer trigger an
interrupt.
The KEY STOP statement also disables the interrupt. However, if the interrupt is
subsequently enabled with the KEY ON statement, execution will then branch to
the interrupt service routine defined by the ON KEY GOTO or ON KEY GOSUB
statements.
Execute the KEY OFF statement at the end of the program.
Program Example:
10
OPEN #1, “TERM:(42)”
20
ON KEY 1 GOSUB 100
30
On KEY 2 GOSUB 200
40
A=0
50
KEY ON
60
GOTO 60
100
PC READ “14”;A
110
RETURN
200
PC WRITE “14”;A
210
RETURN
LET Statement
Purpose:
To assign the value of an expression on the right side of an equal
sign to the variable on the left side
Format:
[LET] <variable>=<expression>
Example:
LET A = 1.2
Remarks:
Notice the word LET is optional, i.e., the equal sign is sufficient when assigning
an expression to a variable name.
Assignment of a character variable to a numeric variable, and the reverse, are
not permitted.
When assigning unmatched types of numeric variables, the variable type on the
right side of the equal sign is converted into the type on the left before the assign-
ment is performed.
String assignments should be enclosed in double quotation marks.
LINE INPUT Statement
Purpose:
To input an entire line of characters (up to 255) from the key-
board or other input device without the use of delimiters
Format:
LINE INPUT [#<port>,] [“<prompt>”;]<string>
<port> is the port number (1 or 2).
“<prompt>” is a message displayed on the screen prompting the
user for input.
<string> is a string variable that is assigned to the input charac-
ter string.
Example:
LINE INPUT #2,”DATE”;A$
Commands, Statements, and Functions
Содержание C500-ASC04
Страница 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Страница 5: ...iv ...
Страница 7: ...vi ...