Left$; Len; Let - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

LEFT$
LE FT $ ( <string expression> , <required length> )
10 C LS
20 a$="AMSTRAD"
30 FOR n=1 TO 7
40 PRINT LEFT$(a$,n)
50 NEXT
run
FUNCTION: Returns the number of characters (in the range 0 to 255) specified in the
<required length> parameter, after extracting them from the LE FT of the <string
expression>.
If
the <string expression> is shorter than the <required length>, the whole
<string expression> is returned.
Associated keywords:
M I D
$,
RIG
HT $
LEN
LE N ( <string expression> )
10 LINE INPUT "Enter a phrase";a$
20 PRINT "The phrase is";
30 PRINT LEN(a$);"characters
Long."
run
FUNCTION: Returns the total number of characters (i.e. the LENgth) of the <string
expression>.
Associated keywords:
none
LET
LET <variable>
=
<expression>
LET x=100
COMMAND: Assigns a value to a variable. A remnant from early BASICs where
variable assignments had to be 'seen coming'. Has no use in AMSTRAD BASIC apart
from providing compatibility with the programs supplied in early BASIC training
manuals. The above example need only be typed in:
x=.100
Associated keywords:
none
Complete List of Keywords
Chapter 3 Page 39

Advertisement

Table of Contents
loading

Table of Contents

Save PDF