SCREEN pages

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
DragonEye Software
Newbie
Posts:2
Joined:Tue Dec 28, 2004 7:52 pm
Location:Somewhere between this website and the next dimension
Contact:
SCREEN pages

Post by DragonEye Software » Tue Dec 28, 2004 7:59 pm

Could someone shed some light on the PAGE functions used in SCREEN Statement?

QB HELP States:
SCREEN mode% [, [colorswitch%] [, [activepage%] [, visiblepage%]] ]

What exactly are the PAGE functions used for?

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Tue Dec 28, 2004 11:32 pm

You can use them to draw on a page in memory, and then display all the graphics at once using PCOPY. Here's a cheap example to show you how it works... :P

Code: Select all

DEFINT A-Z
SCREEN 7, , 0, 1

DO
 CLS ' clear the backbuffer, Page 0.

 ' Draw some stuff on the backbuffer
 FOR R = 1 TO 100
  Col = INT(RND * 15) + 1
  CIRCLE (INT(RND * 320), INT(RND * 200)), 16, Col
  PAINT STEP(0, 0), 0, Col
  PAINT STEP(0, 0), Col, Col
 NEXT

 WAIT &H3DA, 8'Wait for vertical retrace
 WAIT &H3DA, 8, 8'
 PCOPY 0, 1'Copies the Active Page 0 to the Visual Page 1, which is the screen.
LOOP UNTIL INKEY$ = CHR$(27) 'ESC to exit

Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!

DragonEye Software
Newbie
Posts:2
Joined:Tue Dec 28, 2004 7:52 pm
Location:Somewhere between this website and the next dimension
Contact:

Post by DragonEye Software » Wed Dec 29, 2004 2:07 pm

Alrighty then, thanks, ill give it a shot. :)
You cant learn something unless you mess with it or ask someone.

Post Reply