Exception
Download
1 / 10

Exception - PowerPoint PPT Presentation


  • 54 Views
  • Uploaded on

Exception.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Exception' - brent


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Exception adalahsebuahistilahpemrograman yang mengacupadaperkecualian yang diakibatkankesalahanpadawaktumenjalankan program dantidakdapatdiketahuiataudidefinisikanpadawaktukompilasi. Lebihjauhlagicaratersebutdinamakandenganexception handling (penangananpengecualian).


Try except
Try… Except…

Bilatidakterjadiexception, makasemuabarispadabagian try akandijalankan, namunbagianexcept tidakakandijalankandansebaliknya.



Try except2
Try… Except…

var

bil: integer;

Begin

bil:= StrToInt(Edit1.Text);

showmessage('Input Benar : '+IntToStr(bil));

End;



Try except4
Try… Except…

var

bil : integer;

Begin

try

bil := StrToInt(Edit1.Text);

showmessage('Input Benar : '+IntToStr(bil));

except

MessageDlg('SalahInput',mtError,[mbOK],0);

end;

End;


Try except5
Try… Except…

Tools > Options…

Pilih : Debugger > Language Exeptions

Add > EConvertError



Try except7
Try… Except…

var

bil: integer;

Begin

try

bil:= StrToInt(Edit1.Text);

showmessage('Input Benar : '+IntToStr(bil));

except

onE:EConvertError do

MessageDlg(E.message,mtError,[mbOK],0);

end;

End;


ad