Download Print this page

VTech PreComputer 2000 Manual page 41

Advertisement

MID$ (A$,M,N)
This function return a substring of the string A$ star:ting from the Mth character
with a length of Nth characters.
Example:
10
A$="ABCDEFGH"
20 B$=MID$(A$,2,3)
30 PRINT B$
RUN
BCD
ASC(A$)
The ASC statement will return the ASCII code (in decimal) for the FIRST character
of the specified string
.
Brackets must enclose the string specified
.
Refer to the
appendix for the ASCII code table (Pg .56). For example the ASCII decimal value
of "X" is 88. If
A$="XAB",
then ASC (A$)=88
.
Example:
10 X=ASC("ROY")
20 PRINT X
RUN
82
CHR$ (N)
This statement works the opposite way as the ASC statement
.
The CHA$
statement will return the string character which corresponds to the given ASCII
code. The argument may be any number from 32 to 127 or any variable expression
with an integer value within that range
.
Brackets must be put around the argument.
Example:
30 PRINT CHR$(68)
RUN
D
40

Advertisement

loading