GetMessage( ) method (Class)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns the error message for the indexed error in the error object. If there is no error message at the indicated index, the method returns the empty string.
Return type: CHARACTER
Access: PUBLIC
Applies to: Progress.Lang.ProError class, System.Exception class (OpenEdge-enhanced)
Syntax
|
- MessageIndex
- The NumMessages property indicates the number of error message and number pairs in an error object. Specify an index between 1 and the value of the NumMessages property.
For a .NET System.Exception class, the information from the current object reference is used to populate message 1. If there is an InnerException, its information is used to populate message 2. This process continues down through any other nested InnerExceptions. The format of each message is:
|
For example, if you pass the value 2 to access the third member of a control collection and there are less than three elements in the collection you will get this message:
|
The string "Index 2 is out of range" is the value of the Exception Message property.