EasyManua.ls Logo

AMSTRAD CPC464 - Page 180

AMSTRAD CPC464
249 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
WEND
WEND
10 MODE 1:REM BASIC CLOCK TIME ROUTINE
20 INPUT "Enter the current hour, minute, and
second (h,m,s)"; hour,minute,second
30 CLS:datum = INT(TIME/300)
40 WHILE hour<13
50 WHILE minute<60
60 WHILE tick<60
70 tick=(INT(TIME/300)-datum)+second
80 LOCATE 70,4
90 PRINT #O,USING “## ";hour,minute,tick
100 WEND
110 tick=0
115 second=0
120 minute=minute+l
130 GOT0 30
140 WEND
150 minute=0
160 hour=hour+l
170 WEND
180 hour=1
190 GOT0 40
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 <logical expression>
WHILE DAY<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

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals