AMSTRAD CPC464 User Manual page 158

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

NEXT
N E X T [ < l i s t o f : < v a r i a b l e > ]
F O R n = 1 T O 1 0 0 0 : N E X T
COMMAND: Delimits the end of a FOR loop. The NEXT command may be anonymous, or may refer
to its matching FOR , which in the above example would be:
NEXT n
Associated keywords: FOR
ON GOSUB
ON GOTO
ON < i n t e g e r e x p r e s s i o n > G O S U B < l i s t o f : < l i n e n u m b e r >
ON < i n t e g e r e x p r e s s i o n > G O T O < l i s t o f : < l i n e n u m b e r >
1 0 O N D A Y G O S U B 1 0 0 , 2 0 0 , 3 0 0 , 4 0 0 , 5 0 0
1 0 O N R A T E G O T 0 1 0 0 0 , 2 0 0 0 , 3 0 0 0 , 4 0 0 0
COMMAND: GOSUB to the subroutine, or GOTO the statement as directed by the result of the
<integer expression>. If the result is 1, then the first line number in the list is chosen, if 2 then the
second etc. In the above line 10, when DAY = 1, the subroutine at line 100 would be visited.DAY =2
would cause a branch to line 200, and so on.
Associated,keywords: GOTO, GOSUB
ON BREAK GOSUB
O N B R E A K G O S U B < l i n e n u m b e r >
1 0 O N B R E A K G O S U B 4 0
2 0 P R I N T " p r o g r a m r u n n i n g "
3 0 G O T 0 2 0
4 0 C L S
5 0 P R I N T " p r e s s i n g [ E S C ] t w i c e c a l l s G O S U B
r o u t i n e "
6 0 F O R t = l T O 2 0 0 0 : N E X T
7 0 R E T U R N
COMMAND: Calls a subroutine on breaking from program execution by pressing [ESC] twice.
Associatedkeywords: ON
BREAK STOP, RETURN

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents