Download Print this page

VTech PreComputer 2000 Manual page 39

Advertisement

LEN
This function computes the length of the string argument
,
which must be in
brackets
.
So if you type PRINT LEN ("JOHN") the computer will return the result
4.
This is telling you that there are 4 characters in the string
"JOHN".
Blank spaces
have the value of characters
.
Thus if you put in spaces "J O H
N",
it comes out
as 7
characters.
STA$
The STR$ function changes a number argument into a string. Let us take a look
at the following example and see how
tt
works.
Example:
I
A$=STR$(73)
This is the same as saying A$="73"
.
Here is sample program
Example:
VAL
10
A$=STR$(7*
3)
20
B$=A$+"BIG"
30 PRINT B$
RUN
21BIG
VAL works like STR$ but in reverse. It changes a string argument into a number.
Look at the following short program.
Example:
10 A$="33"
20 B$="20"
30 C=VAL(A$+B$)
40 PRINT C;C+100
RUN
3320
3420
38

Advertisement

loading