GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The GetLastError function returns error information in the form of an integer error code. This information pertains to result of the previously called function. This function should be called immediately after the suspect function or after an IsError function.
Syntax/Parameters
Syntax
dword = GetLastError ( );
Parameters
(none)
Return Value
Returns an dword containing the error code supplied by the last function called. Error codes are either a simple code (ie., ERROR_FILE_NOT_FOUND (2)) or formatted error code with high bits such as ERROR_SOFT (0x80000000). Programmers should avoid using an integer data type to accept structured return codes since an int may sign extend resulting in incorrect comparisons.
Remarks
Most functions will populate the return value of the GetLastError function with error information. If the function returns an integer, the GetLastError function may duplicate its error return codes or supply additional error information. For functions whose return values are ambiguous, such as functions that return strings or functions that can return values such as -1 as both an error or as an allowable value, the GetLastError function must be used to identify an error. If the previous called function succeeded, the GetLastError function will return 0 or ERROR_NONE. The IsError function can be used to aid in easily identifying errors.
Within the script engine, the last error code is reset for the majority of Legato SDK functions. This means that the value returned by the GetLastError will most likely be reset by calling another function. Therefore the error value should be retrieved prior to calling any additional SDK functions. User-defined functions will not adjust the value of the last error. Error checking functions do not alter the content of the last error buffer.
Main code filters are ERROR_MASK to get the type of errors and ERROR_CODE_MASK to get the related error code. For further information and formatted error code structure see Section 5.20 Error Processing and Codes.
For more information on error reporting, see Appendix A — Legato SDK Standard Definitions and Windows SDK System Error Codes.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.