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.