[Overview][Constants][Types][Procedures and functions][Variables][Index] | Reference for unit 'Crt' (#rtl)

# Window

Create new window on screen.

## Declaration

Source position: crth.inc line 82

`procedure Window(`
`X1: Byte;`
`Y1: Byte;`
`X2: Byte;`
`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 |  | Set cursor position on screen.
WhereX |  | Return X (horizontal) cursor position
WhereY |  | Return Y (vertical) cursor position
ClrScr |  | Clear current window.

## 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.

Documentation generated on: Feb 26 2014