home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
100UTILI
/
LRNBAS-3.ZIP
/
ADVR_EX
/
WINDO_EX.BAS
< prev
Wrap
BASIC Source File
|
1988-11-08
|
1KB
|
35 lines
' *** WINDO_EX.BAS -- WINDOW statement programming example ***
' This program uses WINDOW in a subprogram, Zoom, to show how
' changing the window size changes the size of a figure drawn
' on the screen. As the window gets smaller, the figure appears
' larger, and vice versa.
'
DECLARE SUB Zoom (X)
CLS ' Clear screen
PRINT "Press ENTER to start."
PRINT "Press any key to halt execution."
INPUT ; "", A$
SCREEN 1: COLOR 7 'Grey screen.
X = 500: Xdelta = 50
DO
DO WHILE X < 525 AND X > 50
X = X + Xdelta 'Change window size.
CALL Zoom(X)
FOR I = 1 TO 1000 'Delay loop.
IF INKEY$ <> "" THEN END 'Stop if key pressed.
NEXT
LOOP
X = X - Xdelta
Xdelta = -Xdelta 'Reverse size change.
LOOP
SUB Zoom (X) STATIC
CLS
WINDOW (-X, -X)-(X, X) 'Define new window.
LINE (-X, -X)-(X, X), 1, B 'Draw window border.
CIRCLE (0, 0), 60, 1, , , .5 'Draw ellipse with x-radius 60.
PAINT (0, 0), 1 'Paint ellipse.
END SUB