PAGE statement

Purpose

Select which of 8 console text pages (screens) is active and/or visible.

Syntax

PAGE [active] , [visible]

Remarks

The active page is the page where console output is created using the PRINT, LOCATE and CLS statements, etc.  The visible page is the page currently being displayed. Both parameters are optional although the comma is not.  If specified, each parameter must be in the range of 1 to 8 inclusive.  If either parameter is omitted, the previous page number for the missing parameter remains in effect.  If either parameter is invalid, the entire operation is ignored.

Using separate active and visible pages provides a mechanism for application screens to be constructed in the background, and copied to the visible page (using PCOPY) for instant screen updates.

If redirection is not in effect, STDOUT writes its output to page 1 regardless of the current PAGE settings.

Using two or more console pages is a simple yet very effective technique to vastly speed up the screen display in Windows 95, 98, and ME.  See the example code below.

See also

CLS, LOCATE, PAGEACTIVE, PAGEVISIBLE, PCOPY, PRINT, STDOUT

Example

FUNCTION PBMAIN

CLS

  PAGE 2,1

  FOR x& = 65 TO 90

    PRINT STRING$(SCREENX * SCREENY, x&);

    PCOPY 2,1

  NEXT x&

  PAGE 1,1

  WAITKEY$

END FUNCTION