Omron SYSMAC C200H-ASC02 Operation Manual page 49

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

Advertisement

BASIC Language
LET Statement
LINE INPUT Statement
MID$ Statement
100
PC READ "@D,0,1,14";A
110
RETURN
200
PC WRITE "@D,0,1,14";A
210
RETURN
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 assign-
ing 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
assignment is performed.
String assignments should be enclosed in double quotation marks.
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$
Remarks:
All of the characters input from the end of the prompt to the carriage return
are assigned to the character variable as a series of data. (Commas and co-
lons are also treated as character data.)
A question mark is not displayed unless it is part of the prompt string.
The prompt statement is not displayed if a peripheral device other than
TERM or COMU is selected with the OPEN statement.
The character string is not assigned to the variable until the carriage return
key is pressed. Until then, the BASIC LED indicator on the ASCII Unit will
blink indicating that the Unit is waiting for input of a carriage return.
If the port number is omitted, port 1 is assumed as the default port.
Purpose:
To replace a portion of one string with another string
Format:
MID$(<string 1>,<n>[,<m>]) = <string 2>
<string 1> is a string variable.
<n> is an integer expression from 1 to 255.
Section 4-2
39

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents