Using; Val; Vpos - AMSTRAD cpc 6128 User Instruction

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

Advertisement

USING
(See P R I N T U SIN G)
VAL
V A L ( <string expression> )
10 CLS:PRINT "I know my times tables!"
20 PRINT:PRINT "Press a key (1 to 9)"
30 a$=INKEY$: IF a$="" THEN 30
40 n=VAL(a$):IF n<1 OR n>9 THEN 30
50 FOR x=1 TO 12
60 PRINT n;"X";x;"=";n*x
70 NEXT:GOTO 20
run
FUNCTION: Returns the numeric V A Lue, (including any negative sign and decimal
point) of the first character(s) in the specified <string expression>.
If
the first character is not a number, then 0 is returned. If the first character is a
negative sign or decimal point followed by non-numeric characters, a
'T
y P e
m;
s
m
ate
h'
error (13) will be reported.
Associated keywords: S T R
$
VPOS
V P 0 S (
#
<stream expression> )
10 MODE 1:BORDER 0:LOCATE 8,2
20 PRINT "use cursor up/down keys"
30 WINDOW 39,39,1,25:CURSOR 1,1
40 LOCATE 1,13
50 IF INKEY(0)<>-1 THEN PRINT CHR$(11);
60 IF INKEY(2)<>-1 THEN PRINT CHR$(10);
70 LOCATE #1,3,24
80 PRINT #1,"text cursor ";
90 PRINT #1,"vertical position =";
100 PRINT #1,VPOS(#0):GOTO 50
run
FUNCTION: Reports the current Vertical PO Sition of the text cursor relative to the
top of the text window. The <stream expression> MUST be specified, and does NOT
default to #0.
Associated keywords: PO S, WIN D 0 W
Complete Licot of Keywords
Chapter 3 Page 87

Advertisement

Table of Contents
loading

Table of Contents