_getactivepage

Description

Gets the current active page number.

#include <graph.h>

short __far _getactivepage( void );

Remarks

The _getactivepage function returns the number of the current active page.

Return Value

The function returns the number of the current active video page. All hardware combinations support at least one page (page number 0).

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_getvideoconfig, _getvisualpage, _grstatus, _setactivepage, _setvideomode, _setvisualpage

Example

/* PAGE.C illustrates video page functions including:

* _getactivepage _getvisualpage _setactivepage _setvisualpage

*/

#include <conio.h>

#include <graph.h>

#include <stdlib.h>

void main( void )

{

short oldvpage, oldapage, page, row, col, line;

struct _videoconfig vc;

char buf[80];

_getvideoconfig( &vc );

if( vc.numvideopages < 4 )

exit( 1 ); /* Fail for or monochrome. */

oldapage = _getactivepage();

oldvpage = _getvisualpage();

_displaycursor( _GCURSOROFF );

/* Draw arrows in different place on each page. */

for( page = 1; page < 4; page++ )

{

_setactivepage( page );

_settextposition( 12, 16 * page );

_outtext( ">>>>>>>>" );

}

while( !_kbhit() )

/* Cycle through pages 1 to 3 to show moving image. */

for( page = 1; page < 4; page++ )

_setvisualpage( page );

_getch();

/* Restore original page (normally 0) to restore screen. */

_setactivepage( oldapage );

_setvisualpage( oldvpage );

_displaycursor( _GCURSORON );

}