qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PAGES.PAS
  Example Contents Index                                    Back
 
PROGRAM page_animation;
 
{ PAGES.PAS : Uses video pages to animate screens }
 
USES
    MSGraph, Crt;
 
CONST
    jumper : ARRAY[0..3] OF STRING = ('/O\', '-O-', '\O/', 'WOW');
 
VAR
    a, i      : Integer;
    oldvpage  : Integer;
    oldapage  : Integer;
    vc        : _VideoConfig;
    oldcursor : Boolean;
 
BEGIN    { Begin main program }
 
    _ClearScreen( _GClearScreen);
 
    oldapage := _GetActivePage;
    oldvpage := _GetVisualPage;
 
    { Set the video mode for a large text size }
    a := _SetVideoModeRows( _TextBW40, 25 );
    _GetVideoConfig( vc );
 
    IF ((a = 0) OR (vc.NumVideoPages < 4)) THEN
        BEGIN
        Writeln( '_TEXTBW40 mode not available;' +
                 ' hit Return to continue' );
        Readln;
        a := _SetVideoMode( _DefaultMode );
        Halt( 0 );
        END;
 
    { Turn off flashing cursor. }
    oldcursor := _DisplayCursor( False );
 
    { Draw image on each page. }
    FOR i := 0 TO 3 DO
        BEGIN
        _SetActivePage( i );
        _SetTextPosition( 12, 20 );
        _OutText( jumper[i] );
        END;
 
    { Cycle through pages 0 to 3. }
    REPEAT
        FOR i := 0 TO 3 DO
            BEGIN
            _SetVisualPage( i );
            Delay( 500 );
            END;
    UNTIL KeyPressed;
 
    { Restore everything before ending the program. }
    a := _SetVideoMode( _DefaultMode );
    _SetActivePage( oldapage );
    _SetVisualPage( oldvpage );
 
END.