TIP: Click on subject to list as thread! ANSI
echo: delphi
to: GARY WEINFURTHER
from: JORGEN DE GIER
date: 1997-01-13 20:43:00
subject: raise

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.