
7-6
Section
Details of BASIC Commands
173
If the port number is omitted then port #1 is assumed for the
statement and port #2 is
assumed for the
LPRINT
statement.
If the specified port is not configured as an output device then a “CANNOT WRITE TO A
READ-ONLY DEVICE” error (code 0059) will occur.
LPRINT
will execute according to the “CTS_ON, RTS_OFF, DSR_ON” status, even if the
OPEN
command is not specified.
Note:
1.
The port must be opened for output.
2.
If the specified number of digits to be output is greater that that specified in the
numerical format a% will be output before the numerical value.
3.
If <expression> does not correspond to the <print format> string then a “TYPE
MISMATCH” error (code B013) will occur.
Examples:
> 10 LINE INPUT “ENTER A STRING : “; A$
> 20 OPEN #2, “LPRT:”
> 30 LPRINT #2, A$
> 40 PRINT “THE STRING YOU ENTERED - “;A$;” - WAS SENT TO THE
PRINTER”
> RUN
ENTER A STRING : TEST
THE STRING YOU ENTERED - TEST - WAS SENT TO THE PRINTER
See also:
,
WAIT
mid$
Syntax:
MID
$ (<string expression>, < numerical expression 1>[, < numerical expression 2>])
Description:
Function Returns the specified number of characters starting from the specified position in a
string expression.
Remarks:
<string expression> is the string to be searched.
<numerical expression 1> is the starting position in the string to be searched. Valid range:
[1…255].
<numerical expression 2> is the number of characters to be returned. Valid range: [0…255].
If the number of characters to be returned is 0, or if the starting position is greater than the length
of the search string, then a null string is returned. If the number of characters to be returned is
greater than the number of characters remaining in the search string then the entire search string
from the starting position is returned.
If <numerical expression 2> is omitted, or exceeds the number of characters to the right of the
starting position, then all of the characters to the right of the starting position are returned.
Examples:
> 10 A$ = “HELLO WORLD AGAIN”
> 20 B$ = MID$ (A$, 7, 5)
> 30 PRINT B$
> RUN
WORLD
See also:
LEFT
$,
RIGHT
$
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...