Hallo Gary,
Gary Weinfurther schreef dit aan Jorgen De Gier:
JDG>> I want to raise an exception in a BeforeInsert event to prevent
JDG>> inserting records. But I don't want a MessageBox, which all
JDG>> exceptions seems to have. Is there any way to 'silently' raise an
JDG>> exception?
GW> The message box appears only if the exception has not been handled. You
GW> "handle" an exception by using a try..except block.
I'm familiar with exceptions with my C++ background. The helpfile says I have
to raise *an* exception to prevent inserting. I could do
try
myvar div 0;
except on EDivideByZeroError: { or whatever it's called }
exit;
end;
but it's not very gracefull.
Toedeloe,
Jorgen de Gier
--- GEcho 1.00
---------------
* Origin: Hoi! (2:280/606.9)
|