17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

WINDOW Statement<br />

Purpose:<br />

To draw lines, graphics, and objects in space not bounded by the physical limits of the screen.<br />

Syntax:<br />

WINDOW[[SCREEN](x1,y1)-(x2,y2)]<br />

Comments:<br />

(x1,y1), (x2,y2) are the coordinates defined by the user. These coordinates, called the world<br />

coordinates, may be any single-precision, floating-point number. They define the world<br />

coordinate space that graphics statements map into the physical coordinate space, as defined by<br />

the VIEW statement.<br />

WINDOW is the rectangular region in the world coordinate space. It allows zoom and pan. It allows<br />

the user to draw lines, graphics, and objects in space not bounded by the physical limits of the<br />

screen. To do this the user specifies the world coordinate pairs (x1,y1) and (x2,y2.) GW-<br />

BASIC then converts the world coordinate pairs into the appropriate physical coordinate pairs for<br />

subsequent display within screen space.<br />

Window inverts, with the screen attribute omitted, the y coordinate on subsequent graphics<br />

statements. This places the (x1,y1) coordinate in the lower-left and the (x2,y2) coordinate in<br />

the upper-right of the screen. This allows the screen to be viewed in true Cartesian coordinates.<br />

The coordinates are not inverted when the SCREEN attribute is included. This places the (x1,y1)<br />

coordinate in the upper-left and the (x2,y2) coordinate in the lower-right corner of the screen.<br />

The WINDOW statement sorts the x and y argument pairs into ascending order. For example:<br />

WINDOW (50, 50)-(10, 10)<br />

becomes<br />

WINDOW (10, 10)-(50, 50)<br />

Or<br />

WINDOW (-2, 2)-(2, -2)<br />

becomes<br />

WINDOW (-2, -2)-(2, 2)<br />

All coordinate pairs of x and y are valid, except that x1 cannot equal x2 and y1 cannot equal y2.<br />

WINDOW with no arguments disables previous window statements.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/WINDOW.html (1 of 2)28/03/2004 21.29.53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!