
7-6
Section
Details of BASIC Commands
174
mid$
Syntax:
MID
$ (<string 1>, < numerical expression 1>[, < numerical expression 2>]) = <string 2>
Description:
Statement Replaces a portion of one string expression with another string expression.
Remarks:
<string 1> is the string where the characters from <string 2> should be replaced.
<string 2> is the string variable containing the letters to be replaced in <string 1>
<numerical expression 1> is the starting position for replacing characters in <string 1>. Valid
range: [1…255].
<numerical expression 2> is the number of characters from <string 2> to be inserted. Valid range:
[0…255]. If this is omitted all of the characters from <string 2> will be inserted in <string 1>.
No matter if <numerical expression 2> is omitted or not the total length of the original <string 1>
cannot be exceeded.
<numerical expression 1> cannot specify a character position that exceeds the number of
characters in <string 1>.
Examples:
> 10 A$ = “HELLO WORLD”
> 20 MID$(A$, 7, 5)=”AGAIN”
> 30 PRINT A$
RUN
HELLO AGAIN
See also:
LEFT
$,
RIGHT
$,
MID
$ (function)
model
Syntax:
MODEL
Description:
System Variable. This read-only variable gives the model of the current ASCII Unit.
Remarks:
Returns the model of the current ASCII Unit.
1: ASC11
2: ASC21
3: ASC31
Examples:
> 10 IF MODEL=1 THEN PRINT “THIS UNIT IS AN ASC11” : GOTO 50
> 20 IF MODEL=2 THEN PRINT “THIS UNIT IS AN ASC21” : GOTO 50
> 30 IF MODEL=3 THEN PRINT “THIS UNIT IS AN ASC31” : GOTO 50
> 40 PRINT “UNKNOWN MODEL OF ASCII UNIT”
> 50 END
> RUN
THIS UNIT IS AN ASC21
See also:
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...