Right$; Rnd - AMSTRAD cpc 6128 User Instruction

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

Advertisement

RIGHT$
RIG H-T
$ (
<string expression> , <required length> )
10 MODE 1:a$="CPC6128 computer"
20 FOR n=1 TO 16:LOCATE 41-n,n
30 PRINT RIGHT$(a$,n)
40 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 RIG H T of the <string
expression>. If the <string expression> is shorter than the <required length>, the whole
<string expression> is returned.
Associated keywords: LE FT $, M I D $
RND
R N D [ ( <numeric expression> ) ]
10 RANDOMIZE
20 FOR x=1 TO -1 STEP -1
30 PRINT "rnd parameter=";x
40 FOR n=1 TO 6
50 PRINT RND(x)
60 NEXT n,x
run
FUNCTION: Returns the next RaN Dom number m sequence if the <numeric
expression> has a positive value or is not specified.
If the <numeric I?xpression> yields a value of zero, RN D returns a copy of the last
random number generated.
If the <numeric expression> yields a negative value, a new random number sequence
is started, the first number of which is returned.
Associated keywords: RAN DO M I Z E
Complete List of Keywords
Chapter 3 Page 69

Advertisement

Table of Contents
loading

Table of Contents