Function DosError() Foundation
Retrieves the last operating system error code.
DosError( [<nNewOsErrorID>] ) --> nErrorID
DosError() returns an integer numeric value which represents an error code of the operating system.
The function name DosError does not designate the operating system DOS but is translated as Disk-Operating-System-Error. The function returns a numeric code. In 32bit operating systems there are many more error codes than in the operating system DOS. However, the first 88 error codes of the operating systems DOS, OS/2, Windows 9x and Windows NT are the same.
DosError() is an error function which returns the last error code of the operating system. An error code is set whenever a runtime error occurs. DosError() is often used in runtime error code blocks activated by the function ErrorBlock(). Ordinarily DosError() is checked after a RECOVER statement. The value of the function remains until a new runtime error occurs or it is redefined using <nNewOsErrorID>. When there is not an operating system error code for a failed operation, the function DosError() returns the value zero. When an error occurs with the low level file functions, the function FError() returns the same value as DosError().
The textual description of the error code can be retrieved by the function DosErrorMessage().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.