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.
CRT2.PAS
  Example Contents Index                                    Back
 
PROGRAM crt2;
 
{ CRT2.PAS : Program to test screen and cursor control }
 
USES
    Crt;
 
CONST
    wait = 1500;
 
VAR
    c : Char;
 
PROCEDURE beep;
BEGIN
    Sound( 1500 );
    Delay( 200 );
    NoSound;
END; { procedure beep }
 
BEGIN
 
    ClrScr;
    Writeln( 'This is line 1' );
    Writeln( 'This is line 2' );
    Writeln( 'This is line 3' );
    Writeln( 'This is line 4' );
    Writeln( 'This is line 5' );
 
    GotoXY( 1, 24 );
    Write( 'Press any key to insert a new line between ' );
    Write( 'lines 4 and 5' );
    c := ReadKey;
 
    beep;
    DelLine; { remove current message line }
    GotoXY( 1, 5 ); { move to line 5 }
    InsLine; { Insert an empty line }
    Delay( wait ); { wait }
    Write( 'This is a new line' );
 
    Delay( wait );
    GotoXY( 1, 24 );
    Write( 'Press any key to delete the new line' );
    c := ReadKey;
    beep;
    DelLine; { remove current message line }
    GotoXY( 1, 5 ); { move to line 5 }
    DelLine; { delete line 5}
 
    GotoXY( 1, 24 );
    Write( 'Press any key to redisplay lines in low video' );
    c := ReadKey;
 
    ClrScr;
    LowVideo;
    Writeln( 'This is line 1 in low video' );
    Writeln( 'This is line 2 in low video' );
    Writeln( 'This is line 3 in low video' );
    Writeln( 'This is line 4 in low video' );
    Writeln( 'This is line 5 in low video' );
 
    GotoXY( 1, 24 );
    Write( 'Press any key to redisplay lines in high video' );
    c := ReadKey;
 
    ClrScr;
    HighVideo;
    Writeln( 'This is line 1 in high video' );
    Writeln( 'This is line 2 in high video' );
    Writeln( 'This is line 3 in high video' );
    Writeln( 'This is line 4 in high video' );
    Writeln( 'This is line 5 in high video' );
 
    GotoXY( 1, 24 );
    Write( 'Press any key to insert a new line between ' );
    Write( 'lines 4 and 5' );
    c := ReadKey;
    beep;
    DelLine;           { remove current message line }
    GotoXY( 1, 5 );    { move to line 5 }
    InsLine;           { insert an empty line }
    Delay( wait );     { wait }
    NormVideo;
    Write( 'This is a new line in normal video' );
 
    GotoXY( 1, 24 );
    Write( 'Press any key to quit ...' );
    c := ReadKey;
 
END.