Chapter
10
I
BASIC
Keywords
IOCTL
Advanced Statement
IOCTL
[#lbuffr,string
Sends
a
control data string
to
a device driver. Control data can
be sent
to
a
drive only after it has been opened.
Buffer
is
the number assigned
to
the driver when you opened it.
The number sign
(#)
is optional.
It
is provided for compatibility
with other BASICs.
String
is
a
string expression containing
a
series
of
commands
called "control data." The commands are generally
2
to
3
charac-
ters long and may be followed by an alphanumeric argument.
The commands are separated by semicolons
(;).
String
may be a
maximum of
255
bytes.
For
more information on device drivers, see the
Programmer's
Reference
manual for your computer.
It
is available at your Radio
Shack Computer Store.
Example
If you write your own driver
to
replace
PRN
to
set the page
length, the IOCTL command may be:
PLn
where
n
is
the new page length.
To open the new
PRN
driver and
set
the page length
at
56
lines
per page, use the following statements:
10
OPEN
"PRN"
FOR
OUTPUT
a5
1
20
IOCTL
1
,"PL56"
188