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 and IOCTL$ Programming Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
'This example uses the IOCTL statement to set the data mode in the driver
'and the IOCTL$ function to test the data mode when communicating with a
'hypothetical device driver.
'Note: The IOCTL$ function works only if the device driver is installed and
'states that it processes IOCTL strings, and only if BASIC performs an OPEN
'statement on the device. Do not run this example in its current form.
OPEN "\DEV\ENGINE" FOR OUTPUT AS #1
'Tells the device that the data is raw.
IOCTL #1, "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