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.
ERDEV and ERDEV$ Function Details
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
ERDEV and ERDEV$ Function Details
Syntax
ERDEV
ERDEV$
ERDEV is an integer function that returns an error code from
the last device to declare an error.
ERDEV$ is a string function that returns the name of the device generating
the error. ERDEV$ will contain the 8-byte character device name if the
error was on a character device, such as a printer. It will contain the
2-byte block name (A:, B:, etc.) if the device was not a character device.
Because ERDEV and ERDEV$ return meaningful information only after an
error, they are usually used in error handlers specified by an
ON ERROR statement.
ERDEV and ERDEV$ cannot be used on the left side of an assignment.
ERDEV is set by the critical error handler (interrupt 24H) when
DOS detects an error that prevents continuing.
The value of ERDEV is a bit-encoded value containing the DOS
error information. The lower eight bits (first byte) contain the DOS
error code, a value from 0 to 12. The upper eight bits (second byte)
contain bits 15, 14, 13, XX, 3, 2, 1, and 0, in that order, of the
device-attribute word. XX indicates the bit is always zero. See the
Microsoft DOS Programmer's Reference for more information about
device-attribute words.