On Saturday, January 11, 2003, 10:11:44 AM, Willliam IT wrote:

> Tidak berhasil! saya coba sbb:

> var
>     Test     : real;
> begin
>     try
>         Test := 78/0;
>      except
>           on E:Exception do ShowMessage( E.Message );
>      end;
> end

> NOTHING happened!!!

Delphi itu pinter. Variable Test di contoh di atas tidak digunakan
untuk apa - apa. IOW, Statement Test := 78/0 adalah statement yang sia
- sia / useless, karena itu tidak dicompile (perhatikan tidak ada
titik biru setelah dicompile)

Kalau contoh anda diubah sedikit, it runs as you expected:
 var
     Test     : real;
 begin
     try
         Test := 78;
         Test := Test/0;
      except
         on E:Exception do ShowMessage( E.Message );
      end;
 end;

> Yang saya harapkan muncul pesan eror system yaitu "Error
> device by Zero ... bla..bla"

Filosofi dari try ... except adalah bahwa kita yang menghandle Error
yang mungkin terjadi. Kalau kita hanya ingin menampilkan Error message
Systemnya aja ya tidak perlu di guard dengan try ... except..

Var
 Test : double;
begin
 Test := 78;
 Test := Test/0;
end;


-- 
Bambang
http://bpranoto.tripod.com
Let's win quizzes!! http://www.itpaystolearn.com/default.asp?ref_id=ADY095

Dancing is a vertical expression of horizontal desire.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Turn flat surfaces into speakers with the Soundbug.
http://us.click.yahoo.com/QWAVSC/onCFAA/xGHJAA/i7folB/TM
---------------------------------------------------------------------~->

Berlangganan: [EMAIL PROTECTED]
Stop Berlangganan: [EMAIL PROTECTED]
Keluhan Milis(Unbouncing,spam,dll): [EMAIL PROTECTED] 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Kirim email ke