'=========================================================================== ' Subject: SIMPLE EXAMPLE OF PCOPY Date: 02-16-98 (17:39) ' Author: David A. Wicker Code: QB, QBasic, PDS ' Origin: pyramax@fastlane.net Packet: GRAPHICS.ABC '=========================================================================== ' Simple example of PCOPY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Written by David A. Wicker Feb 16, 1998 ' pyramax@fastlane.net ' http://www.fastlane.net/~pyramax ' --------------------------------------------------------------------------- ' As always, if you borrow anything from any source code for your ' shareware or freeware projects, please give credit to the original author! ' --------------------------------------------------------------------------- ' DEFINT A-Z and '$DYNAMIC as the first two lines of every QBasic program ' ensure maximum speed and maximum memory capability. ' They are chiseled in every single program I write. DEFINT A-Z '$DYNAMIC DECLARE SUB Update () DECLARE SUB CLR () SCREEN 7, , 1, 0 ' Setup a screen 320x200 with 16 colors. Also, set it so we are VIEWING ' Page # 0 but WRITING to page # 1 . D = 1 N = 50 DO CLR ' This is a simple SUBPROGRAM to clear graphics display. N = N + D IF N = 50 OR N = 100 THEN D = -D CIRCLE (160, 100), 25, 2, , , N / (101 - N) ' The "CIRCLE" command has quite a few options! Tap [F1] with the ' cursor sitting on the word "CIRCLE". Oh, and call it, heads or ' tails. :) Update ' The real magic of SCREEN #7 - up to 8 available playfields ! LOOP UNTIL INKEY$ > "" ' Exit when any key is pressed. "<>" is not needed because no ' keystroke can be less than nothing. :) REM $STATIC SUB CLR LINE (0, 0)-(319, 199), 0, BF ' Use "B" for drawing a hollow box. ' Use "BF" for drawing a filled in box. END SUB SUB Update PCOPY 1, 0 ' Very quick and efficient way to copy screens. You could easily do all ' your graphic work first, then clean it up, then call UPDATE to show ' what changes have occurred since the last time UPDATE was called. ' Tap [F1] on the word "PCOPY" to see full help for this QBASIC command. ' Good usage of the "PCOPY" command can ensure completely flicker-free ' graphic displays every time. END SUB