Development of PB common error capture module

Source: Internet
Author: User
Tags continue empty error handling expression integer range requires valid

Author: Xingda Computer technology company (www.study01job.com) Guo Baoli

In an application, whenever an error occurs, the Application object's Systemerror event can be triggered (individually, the dberror of the Data window, the Itemerror event does not trigger the Systemerror, discussed later), In this event, information about the global object error can be handled so that the user is aware of the error and there is an opportunity to continue executing the program, or the entire application may be closed.

The program design idea is very simple, just open a common error handling window in the Systemerror event of the Application object. The Error-handling window displays an error message and provides a choice of ' continue ' or ' break '. You can design a external type of data window to display these error messages. The program here provides a more practical point is that the PB all can be captured by the Systemerror errors are translated into Chinese, which I believe is more popular with Chinese users, readers can use directly. The error message displays the window's program as follows:

String ls_errmsg

Choose Case Error.Number
Case 1
Ls_errmsg = "Removed by 0"
Case 2
ls_errmsg = "Reference null object"
Case 3
ls_errmsg = "Array Out of Bounds"
Case 4
ls_errmsg = "Enum value out of function range"
Case 5
ls_errmsg = "Negative value encountered in function"
Case 6
ls_errmsg = "Invalid data window row/column specified"
Case 7
Ls_errmsg = "An unresolved external reference appears when joining references"
Case 8
Ls_errmsg = "Reference an array with an empty subscript"
Case 9
ls_errmsg = "DLL function not in current program"
Case 10
ls_errmsg = "parameter type not supported by DLL function"
Case 11
ls_errmsg = "Object file has expired and must be converted to current version"
Case 12
ls_errmsg = "Data window column type does not match GetItem type"
Case 13
Ls_errmsg = "Unknown attribute reference"
Case 14
ls_errmsg = "Open error DLL library for external functions"
Case 15
ls_errmsg = "Error calling external function"
Case 16
Ls_errmsg = "Exceeds length of maximum string"
Case 17
ls_errmsg = "Data Window object referenced in Data window control does not exist"
Case 18
Ls_errmsg = "function does not return value"
Case 19
Ls_errmsg = "Cannot convert name to name in any variable
Case 20
Ls_errmsg = "Failed to prepare database command successfully"
Case 21
Ls_errmsg = "Function not referenced correctly at runtime"
Case 22
Ls_errmsg = "Unknown object type"
Case 23
Ls_errmsg = "Cannot assign an object of type name to an object of type name"
Case 24
Ls_errmsg = "Function call does not match its definition"
Case 25
Ls_errmsg = "Double or real expression overflow"
Case 26
ls_errmsg = "Assign value to Name field is not supported"
Case 27
Ls_errmsg = "Non-integer index cannot be negative"
Case 28
ls_errmsg = "VBX error: NAME"
Case 29
ls_errmsg = "Any variable requires a non-integer set of Values"
Case 30
ls_errmsg = "External object does not support data type: NAME"
Case 31
ls_errmsg = "External object data type not supported: NAME"
Case 32
ls_errmsg = "Name not found when calling external object function name"
Case 33
ls_errmsg = "parameter type is not valid when calling external object function name"
Case 34
Ls_errmsg = "Use incorrect number of arguments when calling external object function name"
Case 35
ls_errmsg = "Error calling external object function name"
Case 36
ls_errmsg = "name was not found when accessing external object property names"
Case 37
ls_errmsg = "Type mismatch when accessing external object property name"
Case 38
Ls_errmsg = "Incorrect number of subscripts when asking for external object property name"
Case 39
Ls_errmsg = "Error accessing external object property name"
Case 40
Ls_errmsg = "does not match any data type in an expression"
Case 41
Ls_errmsg = "There is an illegal arbitrary data type in an expression"
Case 42
Ls_errmsg = "The parameter type specified by the runtime is not the same as the requested parameter type in DLL function name"
Case 43
Ls_errmsg = "Parent object does not exist"
Case 44
Ls_errmsg = "Ancestor's function has conflicting parameters and return type"
Case 45
ls_errmsg = "External Table Overflow"
Case 46
ls_errmsg = "Empty object reference cannot be assigned or passed to the same type of variable"
Case 47
LS_ERRMSG = "variable requires array value"
Case 48
Ls_errmsg = "The size of the array does not match the transformation of the object"
Case 49
Ls_errmsg = "The type of the array does not match the transformation of the object"
Case 50
ls_errmsg = "Distribute Service error"
Case 51
ls_errmsg = "parameter of function or event is not valid"
Case 52
Ls_errmsg = "Distributed communication error"
Case 53
LS_ERRMSG = "Required Server not activated"
Case 54
ls_errmsg = "Server not accepting request"
Case 55
ls_errmsg = "Request non-normal termination"
Case 56
Ls_errmsg = "not fully corresponding request"
Case 57
Ls_errmsg = "Not joined"
Case 58
Ls_errmsg = "Object instance does not exist"
Case 59
ls_errmsg = "Illegal column range"
Case 60
ls_errmsg = "Illegal row range"
Case 61
Ls_errmsg = "Convert a number dimension array to an object illegally"
Case 62
ls_errmsg = "Server Busy"
Case 63
Ls_errmsg = "function or event with no return value used for expression"
Case 64
Ls_errmsg = "Assignment requires array object"
Case Else
ls_errmsg = "Other Error"
End Choose

Dw_error.insertrow (0)
Dw_error.setitem (1, "ErrorNum", String (Error.Number))
Dw_error.setitem (1, "message", ls_errmsg)
Dw_error.setitem (1, "where", Error.windowmenu)
Dw_error.setitem (1, "Object", Error.object)
Dw_error.setitem (1, "event", Error.objectevent)
Dw_error.setitem (1, "line", String (Error.line))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.