Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter SixFile Functions (continued)

ReportFileError Function

Overview

The ReportFileError function presents file access errors in a user-friendly manner.

Syntax/Parameters

Syntax

int = ReportFileError ( string name, int code );

Parameters

name

A string containing the filename and path. This parameter supports UTF encoding for filenames with Unicode characters.

code

An int containing a return code. The code can contain application information, which is stripped off (for example, 0x80000002 is the same as 2).

Return Value

Returns an int as ERROR_NONE.

Remarks

The ReportFileError function creates a friendly box to display file access errors. It is a tool to quickly and easily display errors to the user without having to translate the error code and call a message box function, such as the MessageBox or OkCancelBox functions. The message box will contain information concerning the file that the script attempted to access (as supplied by the name parameter) and information about the error code, if available. Certain common errors appear as follows:

File Not Found (2):

Path Not Found (3):

File Sharing Error (32):

Network Error (64):

Syntax error in path (123):

 

Other common Windows error codes (for a list, see the Appendix or MSDN) may be translated and displayed. Note that the ReportFileError function does not attempt to open the file. It is the programmer’s responsibility to ensure that the dialog refers to the correct filename and path.

If the error code is ERROR_NONE (0) or Windows SDK ERROR_SUCCESS (0), the function does not display a message box.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic