ConSetScreenSize command

 

Usage:

ConSetScreenSize Rows&, Cols&

 

Legacy Syntax:

CONSOLE SET SCREEN Rows&, Cols&

 

Pseudo-object Syntax:

CON.SCREEN = Rows&, Cols&

 

Changes the size of the visible console window, and its screen buffers.

 

The size of the console window, and the buffer for each active page, is changed to the rows and columns specified. Once the console size has been altered, the new size can be retrieved with the ConGetScreenSize function.

 

Because this command sets the page size as well as the screen size, the ConSetPageSize function should be used after ConSetScreenSize if you want a page buffer larger than the visible window.

 

ConSetScreenSize can be used as a function. If it succeeds, the return value is 1. If it does not succeed, the return value is 0. If it does not succeed, it is most likely caused by one or both of the parameters being too large or too small.

 

It is recommended that you use only one of the standard number of rows (25, 43 or 60), if you need your program to run under Windows 95/98/ME.

 

The largest possible console screen size depends on the current font size and on the desktop size. The largest possible size for current settings can be determined by use of ConGetMaxScreenSize. The smallest possible console window is 3 rows of 8 columns.

 

The PB/CC command seems to work to make the screen smaller than the existing size, but not larger. There seems to be little point in emulating this behavior, which is not documented, so ConSetScreenSize can be used to make the screen and window larger or smaller.

 

Even if it does not actually change the window size, the PB/CC command clears all screen pages and makes them the same size as the window, resetting the cursor to 1,1. ConSetScreenSize emulates this behavior.

 

Conversion:

 

#IF %DEF(%PB_CC32)

  CONSOLE SET SCREEN Rows&, Cols&

#ELSE

  ConSetScreenSize Rows&, Cols&

#ENDIF

 

CON.SCREEN = or CONSOLE.SCREEN = may be substituted for CONSOLE SET SCREEN in programs written for PB/CC 6.

 

#IF %DEF(%PB_CC32)

  CON.SCREEN = Rows&, Cols&

#ELSE

  ConSetScreenSize Rows&, Cols&

#ENDIF

 

See Also: ConGetScreenSize, ConGetMaxScreenSize, ConSetPageSize