next up previous contents index
Next: The DOS unit. Up: Procedures and Functions Previous: WhereY

Window

   

Declaration:

Procedure Window (X1, Y1, X2, Y2: Byte) ;

Description:

Window creates a window on the screen, to which output will be sent. (X1,Y1) are the coordinates of the upper left corner of the window, (X2,Y2) are the coordinates of the bottom right corner of the window. These coordinates are relative to the entire screen, with the top left corner equal to (1,1)

Further coordinate operations, except for the next Window call, are relative to the window's top left corner.

Errors:

None.

See also:

GotoXY, WhereX, WhereY, ClrScr

Example
Program Example5;
uses Crt;

{ Program to demonstrate the Window function. }

begin
  ClrScr;
  WriteLn('Creating a window from 30,10 to 50,20');
  Window(30,10,50,20);
  WriteLn('We are now writing in this small window we just created, we '+
          'can''t get outside it when writing long lines like this one');
  Write('Press any key to clear the window');
  ReadKey;
  ClrScr;
  Write('The window is cleared, press any key to restore to fullscreen');
  ReadKey;
{Full Screen is 80x25}  
  Window(1,1,80,25);
  Clrscr;
  Writeln('Back in Full Screen');
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998