2007 May 18 1:45 PM
Hi All,
I am programming a Zbusiness Object.
The problem I am facing is that, no matter what garbage value I give to my Object Key field to instantiate it, it get instantiated.
Instead I want it to thorw me a message showing "Object Not Found".
How shall I go for it ?
Dev
Hi All,
I am programming a Zbusiness Object.
The problem I am facing is that, no matter what garbage value I give to my Object Key field to instantiate it, it get instantiated.
Instead I want it to thorw me a message showing "Object Not Found".
How shall I go for it ?
Dev
2007 May 18 1:54 PM
the method/constructor needs to have a parameter for the output of message.
2007 May 18 3:07 PM
2007 May 19 1:41 AM
when you instantiate an object its Constructor (main method) is called first unless the class its pointing to also has a Class Constructor; in that case the Class Constructor is called before the Constructor.
In the Constructor of the class your object is pointing to (TYPE REF TO) requires to have the necessary coding to catch, handle & raise the exception when you try to instantiate the object with "junk" data. it is recommended to code this in a "TRY...CATCH...ENDTRY" block. if your requirment is to output an error message then this has to be done either via an appropriate parameter of the Constructor of the object or coding your own error message when you handle/raise the exception.
Reward points if useful.
Regards.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |