Board index » delphi » PLEASE Help - try exception little problem !

PLEASE Help - try exception little problem !

Dear Fellow Programmers:
  Can someone please help me ... the following code doesn't trap
  improper numeric input ... where have I gone wrong PLEASE ??
Thanks, Doug.
{---------------------}
    try
      {still causes the program to raise an ugly exception here:}
      kidanswer:=strtoint(AnswerBox.text);
    except
      on EConvertError do
      begin
        ResultLbl.Caption:='Use Numbers Only';
        bailout:=true;
      end;
    end;
{---------------------}
PS: Please email me ..... d...@neumann.une.edu.au
--
   .////.   .//       Doug Colman - Dept of Maths, Stats           .////.   .//
 o:::::::::///    and Computer Science, Uni. of New England,     o:::::::::///

Quote
>::::::::::\\\   Armidale NSW Australia - Ph 067 714408(Aust)   >::::::::::\\\

   '\\\\\'   \\           d...@neumann.une.edu.au                  '\\\\\'   \\
 

Re:PLEASE Help - try exception little problem !


Ha!  I had this problem also.

If I remember correctly, the reason is hidden away on the Environment
Options screen under Debugging.   Switch off Break on exception and
your code should work as expected.

Jiff

--
+--------------------------------------------------------------------+
|             PSYNET LTD => HOME OF THE INTERNET HAMSTER             |
|           PROVIDING BUSINESS WITH SOLUTIONS NOT PROBLEMS           |
+--------------------------------------------------------------------+
|  E-MAIL                          |  Psynet Ltd                     |
|  ad...@gendev.demon.co.uk        |  211 Brodrick Road              |
|  supp...@gendev.demon.co.uk      |  Eastbourne                     |
|  ord...@gendev.demon.co.uk       |  East Sussex.                  |
|                                  |  BN22 9RG   (UK) 1323 507664    |
+--------------------------------------------------------------------+

Other Threads