How to add exception handling in defined ODT objec
I have customized ODT Class with defined properties and method. In main program I initialize the object and invoke the method. my question is :
1. how to add exception handling(delphiscript) in the defined method script.
2. if I have the Raise('...') statement in the method script, does it could be catched in the main program.
I ask these questions because in my script, the exception in the object method script cause some memory scratch. I debug / step through the script, when there is a exception throughing in the method script, it will cause all the variables defined in main program reset to undeclared.
Hope you guys can give me any hints. thanks.
Re: How to add exception handling in defined ODT o
You can handle exceptions that can occur in methods of a class as it is described in the "DelphiScript - Exception Handling" help topic. However, you cannot catch these exceptions in the function where you declare the Class object of the ODT object. We will investigate the problem.
[ QUOTE ]
I debug / step through the script, when there is a exception throughing in the method script, it will cause all the variables defined in main program reset to undeclared.
[/ QUOTE ]
It looks like you leave the scope of variables (a function where they were defined) during the debug. If you do, this behavior is normal as variables don't exist outside of their scope. If the problem persists when you are in the scope of variables, please zip your entire project suite folder along with the log of the failed test execution and send us the archive via our Contact Support Form.