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

IOCTL Statement<br />

Purpose:<br />

To allow GW-BASIC to send a "control data" string to a character device driver anytime after the<br />

driver has been opened.<br />

Syntax:<br />

IOCTL[#]file number,string<br />

Comments:<br />

file number is the file number open to the device driver.<br />

string is a valid string expression containing characters that control the device.<br />

IOCTL commands are generally 2 to 3 characters followed by an optional alphanumeric<br />

argument. An IOCTL string may be up to 255 bytes long, with commands within the string<br />

separated by semicolons.<br />

Examples:<br />

If a user had installed a driver to replace lpt1, and that driver was able to set page length (the<br />

number of lines to print on a page before issuing a form feed), then the following lines would<br />

open the new lpt1 driver and set the page length to 66 lines:<br />

OPEN "LPT1:" FOR OUTPUT AS #1<br />

IOCTL #1, "PL66"<br />

The following statements open lpt1 with an initial page length of 56 lines:<br />

OPEN "\DEV\LPT1" FOR OUTPUT AS #1<br />

IOCTL #1, "PL56"<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/IOCTL.html28/03/2004 21.29.33

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

Saved successfully!

Ooh no, something went wrong!