DosError Function (DWord) | |
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.19
Syntax FUNCTION DosError(
nNewDosCode AS DWORD
) AS DWORD
public static uint DosError(
uint nNewDosCode
)
Request Example
View SourceParameters
- nNewDosCode
- Type: DWord
A DOS error number that changes the value returned by DOSError(). You can use it, for example, to reset the error code when trying to preserve the environment in black-box modules or when trying to counteract the side-effects from other modules.
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:
1FUNCTION Start()
2 Dir AA:
3 QOut(DOSErrString(DOSError()))
4
See Also