Advertisement
Guest User

Untitled

a guest
Jul 18th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.70 KB | None | 0 0
  1. // regarding code bomb at http://stackoverflow.com/questions/17726288/
  2.  
  3. procedure DoSomething_varaint_1;
  4. begin
  5.   if Condition1 then begin
  6.      ShowMessage('Error 1');
  7.      Exit;
  8.   end;
  9.  
  10.   if Condition2 then begin
  11.      ShowMessage('Error 2');
  12.      Exit;
  13.   end;
  14.  
  15.   if Condition3 then begin
  16.      ShowMessage('Error 3');
  17.      Exit;
  18.   end;
  19.  
  20. .....
  21.  
  22.  Do something in the end
  23. ...
  24. end;
  25.  
  26. (********************)
  27.  
  28. procedure DoSomething_varaint_1;
  29. begin
  30.   if Condition1 then
  31.      raise Exception.Create('Error 1');
  32.  
  33.   if Condition2 then
  34.      raise Exception.Create('Error 2');
  35.  
  36.   if Condition3 then
  37.      raise Exception.Create('Error 3');
  38.  
  39. .....
  40.  
  41.  Do something in the end
  42. ...
  43. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement