ThrowException
Description
Throws a PowerBuilder exception or inherited exception, and
replaces the existing exception if there is one.
Syntax
|
1 |
ThrowException (pbobject ex) |
|
Argument |
Description |
|---|---|
|
ex |
The exception to be thrown. The exception must |
Return value
None.
Examples
This code creates a new exception object in the class
user_exception_pspp, invokes its SetMessage function, and throws the
exception:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
pbclass cls; pbmethodID mid; pbobject ex; pbgroup group; PBCallInfo* ci = new PBCallInfo; // Throw exception group = session-> FindGroup("user_exception_pspp", pbgroup_userobject); if (group==NULL) return; cls = session->FindClass(group, "user_exception_pspp"); if (group==NULL) return; ex = session -> NewObject(cls); mid = session-> GetMethodID(cls, "setmessage", PBRT_FUNCTION, "QS"); session-> InitCallInfo(cls,mid,ci); ci-> pArgs[0].SetPBString(session, "Test exception"); session -> InvokeObjectFunction(ex,mid,ci); session -> ThrowException(ex); if (!ThrowToPB) session -> ClearException(); session -> FreeCallInfo(ci); delete ci; return; |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest