HTBasic Help
×
Menu
Index

GRAPHICS INPUT IS Statement

 
The GRAPHICS INPUT IS statement is used to specify the graphic input device. See the Getting Started Guide, Chapter 8, "Graphic Input Drivers" for more information. The default graphics input device is the keyboard. The mouse may also be used for graphic input. An example GRAPHICS INPUT IS statement is:
GRAPHICS INPUT IS 702,"HPGL"
To perform graphic input, the following statements are used:
DIGITIZE X,Y,Status$     !Wait for Point
READ LOCATOR X,Y,Status$ !Immediate Return Point
Here, X and Y are the target variables for the graphic position, and Status$ is an optional string that receives information about the state of the GRAPHICS INPUT IS device. The returned coordinates are in the units defined in the current WINDOW or SHOW statement. The Status$ string contains eight bytes with the following information:
 
Byte
Meaning
1
Indicates End of Stream for a device supporting continuous point stream digitizing. Byte 1 may be used as the pen control value in a PLOT. It is "0" if it is the last of a continuous point stream. It is "1" otherwise, including points from a device supporting only single point digitizing.
2
Comma delimiter character.
3
Clip Indicator - If the character is a "0", then the point is outside the hard-clip limits. If a "1", the point is inside the hard-clip limits, but outside the soft-clip limits (see CLIP). If a "2" then it is inside the soft-clip limits.
4
Comma delimiter character
5
Tracking ON/OFF - If the character is a "0", then tracking is off; if a "1", then tracking is on.
6
Comma delimiter character.
7-8
Button Positions. If S$ is the status string and B is the button number you wish to test, then BIT(VAL(S$[7,8]),B-1) returns one if B is down, and zero if B is up.
 
A point is digitized and the coordinates of that point are assigned to the variables when the keyboard ENTER or CONTINUE keys, a mouse button, or a digitizer button is pressed.