Unload Me alternative for a module
I have a module that has been compiled into an exe. This exe is then used by a DTS package to do some data transformations. When an error occurs in the transformation, an event is written to the applications error log. What I want to do now is if the error log grows to greater than 15KB, I want to exit the app. If I was using a form for this, I could us “Unload Me”. This obviously will not work for a module. The only way I know how to stop the execution within a module is to use the “End” keyword. There has got to be a better option than that.
Any ideas?
Re: Unload Me alternative for a module
Since your not using any forms, are you using any classes? You could create a class to instanciate any
objects. Then on that error call the class_terminate procedure to unload all your objects. Then do the "End".
Also, you can use some APIs to watch the file size and when it reaches your desired size, close down correctly and then "End"?
Re: Unload Me alternative for a module
Quote:
“End” keyword. There has got to be a better option than that
Sounds like you've bought into the "Never use End" tripe.
There is nothing wrong with using END as long as you use it properly, especially in a situation like this.
Now begins the religious war:)