17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

KEY(n) n is a function key number 1-20. 1 through 10 are the function keys<br />

F1 through F10. 11 through 14 are the cursor control keys as follows:<br />

11= CURSOR UP 13= CURSOR RIGHT<br />

12= CURSOR LEFT 14= CURSOR DOWN<br />

15-20 are user-defined keys.<br />

PEN Since there is only one pen, no number is given.<br />

PLAY(n) n is an integer expression in the range of 1-32. Values outside this<br />

range result in "Illegal function call" errors.<br />

STRIG(n) n is 0, 2, 4 or 6. (0=trigger A1; 4=trigger A2; 2=trigger B1; 6=trigger<br />

B2).<br />

TIMER(n) n is a numeric expression within the range of 1 to 86,400. A value<br />

outside of this range results in an "Illegal function call"<br />

error.<br />

RETURN line number This optional form of RETURN is primarily intended for use with<br />

event trapping. The event-trapping routine may want to go back into<br />

the GW-BASIC program at a fixed line number while still<br />

eliminating the GOSUB entry that the trap created.<br />

Special Notes about Each Type of Trap<br />

Use of the nonlocal RETURN must be done with care. Any other<br />

GOSUB, WHILE, or FOR that was active at the time of the trap remains<br />

active.<br />

If the trap comes out of a subroutine, any attempt to continue loops<br />

outside the subroutine results in a "NEXT without FOR" error.<br />

COM Trapping<br />

Typically, the COM trap routine will read an entire message from the COM port before returning.<br />

It is recommended that you not use the COM trap for single character messages, since at high<br />

baud rates the overhead of trapping and reading for each individual character may allow the<br />

interrupt buffer for COM to overflow.<br />

KEY Trapping<br />

Trappable keys 15 to 20 are defined by the following statement:<br />

KEY(n),CHR$[hex code]+CHR$[scan code]<br />

n is an integer expression within the range of 15 to 20 defining the key to be trapped.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/ONCOMN.html (2 of 5)28/03/2004 21.28.58

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

Saved successfully!

Ooh no, something went wrong!