3.4
Commands for string processing
Purpose
Κ
To return the length of a string.
Syntax
Κ
A% = LEN(S$)
Example
Κ
Str$="ABCDEFGHIJK"
L% = LEN(Str$)
PRINT "Len. = ",L%
Description
Κ
A%
is an integer variable to be assigned to the result.
S$
may be a string variable, string expression, or string
constant.
Purpose
Κ
To search if one string exists inside antoher one.
Syntax
Κ
A% = INSTR([N%,] S1$, S2$)
Example
Κ
Str$="ABCGEFGHIJK"
G$="GH"
PRINT INSTR(5,Str$, G$)
PRINT INSTR(3, Str$, "CGE")
Description
Κ
A%
is an integer variable to be assigned to the result.
N%
is a numeric expression. Optional offset N% sets the
position for starting the search.
S1$, S2$
may be a string variable, string expression, or string
constant.
If
S2$
is found in
S1$
, it returns the position of the first
occurrence of
S2$
in
S1$
, from the starting point.
If
N%
is larger than the length of
S1$
or if
S1$
is null, of if
S2$
cannot be found,it return 0.
If
S2$
is null,it return
N%
(or 1 if
N%
is not specified).
T P C 7 0 3 0
Programming Manual Ver. 1.00
24/131