ConSetPage command



ConSetPage ActivePage& [,VisiblePage&]


Legacy Syntax:

PAGE [ActivePage&],[VisiblePage&]


Pseudo-object Syntax:



Sets the active and visible console buffer page numbers.


When the console is first created or allocated, a screen buffer is also created, numbered 1. Up to 7 other screen buffers may be created for the console, numbered 2 to 8, through this command. If a page specified as the active page or visible page does not yet exist, it is created. If it does already exist, it is simply set to be the new active or visible page.


The active page is the one which receives console output. You may use this command to select the active page, 1 to 8, which may be different to the page which is currently visible.


The visible page is the one which is currently shown in the console window. You may use this command to select the visible page, 1 to 8, which may be different to the specified active page.


Allocation of additional pages beyond 1 does not have to be in numerical order. For example, your application can use two pages numbered 1 and 5, though there seems to be no real point in doing this.


Note that the terminology used here and the terminology used by the Windows API is different. Here, the "active" page is the page receiving output, whereas to the Windows API, the active page is the visible page. In the Windows API sending output to different open pages is accomplished by using the appropriate handle.


All screen buffers are always the same size as each other. Screen buffers may be the same size as, or larger than the visible console screen. The first buffer is initially allocated at the system default size, as may have been set by the user. If the program uses the ConSetScreenSize command, all open screen buffers will be reset to the same size as the console screen. The program can then use the ConSetPageSize function to increase the size of all open pages and the size of pages opened after this.




#IF %DEF(%PB_CC32)

  PAGE ActivePage&, VisiblePage&


  ConSetPage ActivePage&, VisiblePage&



#IF %DEF(%PB_CC32)

  PAGE ActivePage&


  ConSetPage ActivePage&



#IF %DEF(%PB_CC32)

  PAGE , VisiblePage&


  ConSetPage -1, VisiblePage&



See Also: ConPageActive, ConPageVisible