全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1022
推到 Plurk!
推到 Facebook!

about exit function

尚未結案
QOO10
初階會員


發表:59
回覆:89
積分:29
註冊:2002-12-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-02-10 09:53:55 IP:61.229.xxx.xxx 未訂閱
請教各位前輩如下問題: procedure deltail.dbgride1colenter(sender:tobject) begin if dsMaster.state = dsInser then begin showmessage('edit'); // abort; // end; end; 其中 showmessage('edit') abort 是否可包成一個 function or procedure ?? 謝謝!!
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-02-10 10:04:41 IP:147.8.xxx.xxx 未訂閱
Why not? From the help: procedure Abort; C syntax: extern PACKAGE void __fastcall Abort(void); Description Use Abort to escape from an execution path without reporting an error. Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user. Abort redirects execution to the end of the last exception block.
QOO10
初階會員


發表:59
回覆:89
積分:29
註冊:2002-12-25

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-02-10 11:42:37 IP:61.229.xxx.xxx 未訂閱
引言: Why not? From the help: procedure Abort; C syntax: extern PACKAGE void __fastcall Abort(void); Description Use Abort to escape from an execution path without reporting an error. Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user. Abort redirects execution to the end of the last exception block.
看了 abort procedure help 但還是不了??可否請您舉如上例..謝謝!!
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-02-10 12:07:47 IP:147.8.xxx.xxx 未訂閱
procedure MyAbort;
begin
    ShowMessage('edit');
    Abort;
end;    procedure deltail.dbgride1colenter(sender:tobject)
begin 
    if dsMaster.state = dsInsert then begin
        MyAbort;
        ShowMessage('Never get executed');
    end;
end;
Since Abort is actually an exception, it will stop the execution until handled.
channel
尊榮會員


發表:67
回覆:707
積分:854
註冊:2002-05-02

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-02-10 13:04:11 IP:211.21.xxx.xxx 未訂閱
您可以使用下列語法!
 
procedure deltail.dbgride1colenter(sender:tobject)
begin 
  if dsMaster.state = dsInser then 
    raise Exception.Create('Edit');
end;
------
~小弟淺見,參考看看~
T.J.B
版主


發表:29
回覆:532
積分:497
註冊:2002-08-14

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-02-10 17:58:06 IP:61.220.xxx.xxx 未訂閱
先宣告  procedure _stare(mode :string);    然後 
  procedure _stare(mode :string);
  begin
   if mode = 'dsinsert' then
   begin
     showmessage('edit');  
     abort;    
   end;
  end;
最後在
procedure deltail.dbgride1colenter(sender:tobject)
begin 
if dsMaster.state = dsInsert then 
begin 
  _stare('dsinsert');
end;
end;
如此即可 ps : dsinser 應該是 dsinsert 是不是你打錯了 天行健 君子當自強不息~~@.@
------
天行健
君子當自強不息~~@.@
QOO10
初階會員


發表:59
回覆:89
積分:29
註冊:2002-12-25

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-02-17 12:29:00 IP:61.229.xxx.xxx 未訂閱
引言: 先宣告 procedure _stare(mode :string); 然後
  procedure _stare(mode :string);
  begin
   if mode = 'dsinsert' then
   begin
     showmessage('edit');  
     abort;    
   end;
  end;
最後在
procedure deltail.dbgride1colenter(sender:tobject)
begin 
if dsMaster.state = dsInsert then 
begin 
  _stare('dsinsert');
end;
end;
如此即可 ps : dsinser 應該是 dsinsert 是不是你打錯了 天行健 君子當自強不息~~@.@ 謝謝您
系統時間:2024-04-16 16:52:12
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!