Function DosErrorMessage() Foundation

Retrieves the textual description of an operating system error code.

Syntax
DosErrorMessage( [<nOsErrorID>], [<cnLanguage>] ) --> cMessage
Parameters
<nOsErrorID>
When the optional argument <nOsErrorID> is specified, its value is used to retrieve the message. The default value is the return value of DosError(). The value of <nOsErrorID> must be numeric and represents an error code of the operating system.
<cnLanguage>
When the optional argument <cnLanguage> is specified, the message will be retrieved for the specified language. The default value is the #define constant LANG_DEFAULT from the file NLS.CH. If a value of data type CHARACTER is passed, the parameter contains a language code according to ISO 639-1. Otherwise, it's either a #define constant listed in Nls.ch or an language ID which can be recognized by the operating system.
Return

The function returns the message for <nOsErrorID>

Description

DosErrorMessage () is an error function which returns the message for a specified error code of the operating system. If the error code is not a valid OS error code, or the requested language is not installed on the system, the function returns an empty string.

Examples
Using DosErrorMessage()
// The example shows the basic usage of the 
// DosErrorMessage() function 

PROCEDURE Main 
LOCAL nFh 

   nFh := FOpen("A:\") 
   IF nFh == -1 
      ? DosErrorMessage(FError()) 
   ENDIF 
RETURN 

Feedback

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.