qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
.clsx
:nCLS Statement Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
CLS Statement Programming Example
 
The following program draws random circles in a graphics viewport
and prints in a text viewport. The graphics viewport is cleared after
30 circles have been drawn. The program clears the text viewport after
printing to it 45 times.
 
RANDOMIZE TIMER
SCREEN 1
' Set up a graphics viewport with a border.
VIEW (5,5)-(100,80),3,1
' Set up a text viewport.
VIEW PRINT 12 TO 24
' Print a message on the screen outside the text viewport.
LOCATE 25,1 : PRINT "Press any key to stop."
Count=0
DO
   ' Draw a circle with a random radius.
   CIRCLE (50,40),INT((35-4)*RND+5),(Count MOD 4)
   ' Clear the graphics viewport every 30 times.
   IF (Count MOD 30)=0 THEN CLS 1
   PRINT "Hello. ";
   ' Clear the text viewport every 45 times.
   IF (Count MOD 45)=0 THEN CLS 2
   Count=Count+1
LOOP UNTIL INKEY$ <> ""