qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
IOCTL$ Function Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
IOCTL$ Function Programming Example
 
This example shows how to communicate with a device driver using a
hypothetical device driver named ENGINE. The IOCTL statement sets the
data mode in the driver and the IOCTL$ function tests the data mode.
 
'   Note: The IOCTL$ function works only if the device driver is
'         installed and states that it processes IOCTL strings, and
'         if BASIC performs an OPEN statement on the device. Do not
'         run this example in its current form.
'
OPEN "DEVENGINE" FOR OUTPUT AS #1
IOCTL #1, "RAW"                   'Tells the device that the data is raw.
'
' If the character driver "ENGINE" responds "false" from
' the raw data mode in the IOCTL statement, then the file
' is closed.
'
IF IOCTL$(1) = "0" THEN CLOSE 1