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 />

POINT Function<br />

Purpose:<br />

To read the color or attribute value of a pixel from the screen.<br />

Syntax:<br />

POINT(x,y)<br />

POINT(function)<br />

Comments:<br />

In the first syntax, x and y are coordinates of the point to be examined.<br />

If the point given is out of range, the value -1 is returned.<br />

See the COLOR and PALETTE statements for valid color and attribute values.<br />

POINT with one argument allows you to retrieve the current graphics coordinates.<br />

POINT(function) returns the value of the current x or y graphics coordinates as follows:<br />

Function Returns<br />

0 the current physical x coordinate.<br />

1 the current physical y coordinate.<br />

2 the current logical x coordinate if WINDOW is active; otherwise, it returns the current<br />

physical x coordinate as in 0 above.<br />

3 the current logical y coordinate if WINDOW is active; otherwise, it returns the current<br />

physical y coordinate as in 1 above.<br />

Example 1:<br />

10 SCREEN 1<br />

20 FOR C=0 TO 3<br />

30 PSET (10, 10),C<br />

40 IF POINT(10, 10)C THEN PRINT "BROKEN BASIC="<br />

50 NEXT C<br />

Example 2:<br />

The following inverts the current state of a point:<br />

10 SCREEN 2<br />

20 IF POINT(I, I)0 THEN PRESET(I, I) ELSE PSET(I, I)<br />

Example 3:<br />

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

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

Saved successfully!

Ooh no, something went wrong!