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 and IOCTL Statement 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 an OPEN statement is
' performed on the device. Do not run this example in its current form.
OPEN "\DEV\ENGINE" 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