Click or drag to resize

DosError Function

X#
Return the last DOS error code associated with an activation of the runtime error block.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION DosError() AS DWORD
Request Example View Source

Return Value

Type: DWord
The number of the last DOS error.
If the failed operation has no associated DOS error, DOSError() returns 0.
Remarks
When a runtime error occurs and the operation has an associated DOS error, DOSError() is set to that error code.
This value is retained until another runtime error occurs or until you set the value of DOSError() by specifying the nNewDosCode argument. With file functions, FError() returns the same value as DOSError().
Examples
The following example displays the DOS error code as a string:
X#
1FUNCTION Start()
2    Dir AA:                        // Bad device
3    QOut(DOSErrString(DOSError()))    
4                                    // Path not found
See Also