AMSTRAD CPC464 User Manual page 180

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

Advertisement

WEND
WEND
1 0 M O D E 1 : R E M B A S I C C L O C K T I M E R O U T I N E
2 0 I N P U T " E n t e r t h e c u r r e n t h o u r , m i n u t e , a n d
s e c o n d ( h , m , s ) " ; h o u r , m i n u t e , s e c o n d
3 0 C L S : d a t u m = I N T ( T I M E / 3 0 0 )
4 0 W H I L E h o u r < 1 3
5 0 W H I L E m i n u t e < 6 0
6 0 W H I L E t i c k < 6 0
7 0 t i c k = ( I N T ( T I M E / 3 0 0 ) -d a t u m ) + s e c o n d
8 0 L O C A T E 7 0 , 4
9 0 P R I N T # O , U S I N G " # # " ; h o u r , m i n u t e , t i c k
1 0 0 W E N D
1 1 0 t i c k = 0
1 1 5 s e c o n d = 0
1 2 0 m i n u t e = m i n u t e + l
1 3 0 G O T 0 3 0
1 4 0 W E N D
1 5 0 m i n u t e = 0
1 6 0 h o u r = h o u r + l
1 7 0 W E N D
1 8 0 h o u r = 1
1 9 0 G O T 0 4 0
COMMAND: The WHILE/WEND loop repeatedly executes a body of program until a given condition
is true. The illustration here uses the WHILE/WEND loop to demonstrate the elegance of programs
constructed using this approach. The body of the features of a variety of different clocks can now be
added. The WEND command terminates the WHILE loop..
Associated keywords: WHILE
WHILE
WHILE <l o g i c a l e x p r e s s i o n >
W H I L E D A Y < 0
see example above
COMMAND: A WHILE loop repeatedly executes a body of program until a given condition is true.
The WHILE command defines the head of the loop, and gives the condition. The WEND command
terminates the WHILE loop.
Associated keywords: WEND

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents