Tandy 1000 Basic Reference Manual page 198

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10 I
BASIC
Keywords
LEFT$
Function
LEFT$(string, num ber)
Returns the specified number of characters from the left portion
of string.
Number must be an integer in the range
1 to 255. If
number is
equal to or greater than the length of the string, BASIC returns
the entire string.
Examples
prints BATTLE.
P R I N T L E F T S ( " B A T T L E S H I P S " ,
6 )
P R I N T L E F T $ C " B I G
F I E R C E
DOG",
28)
Since BIG FIERCE DOG is fewer than 20 characters, BASIC
prints the whole phrase.
Sample Program
7 4 0 A $
=
" T I M O T H Y "
7 5 0
E $
=
L E F T $ ( A $ ,
3 )
7 6 0 P R I N T
E $ ;
" - - T H A T ' S
SHORT FOR " ; A B
When you run this program, BASIC prints:
T I M - - T H A T ' S
SHORT FOR T I M O T H Y
Line 750 gets the
3
left characters of A$ and stores them in
B$.
Line 760 prints these
3
characters, a string, and the original
contents of A$.
196

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents