奇狐社區論壇
在這個頁面顯示本主題全部的 4 個文章

奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- IF then else begin 巢狀判斷結構 (http://www.chiefox.com.tw/bbs/showthread.php?threadid=15222)


由 abelchang 在 2011-03-07 14:28 發表:

IF then else begin 巢狀判斷結構

請問 可以做如下的結構嗎?? 因為會有錯誤所以有此一問

IF then begin


End;

Else begin

if then begin

else begin
// 在這裡出現語法錯誤
end;
End;


由 cgjj 在 2011-03-07 14:37 發表:

回覆: IF then else begin 巢狀判斷結構

引用:
最初由 abelchang 發表
請問 可以做如下的結構嗎?? 因為會有錯誤所以有此一問

IF then begin


End;

Else begin

if then begin

else begin
// 在這裡出現語法錯誤
end;
End;




可以的, 您將
if then begin

else begin
// 在這裡出現語法錯誤


修正為
if then begin

end;
else begin


由 cgjj 在 2011-03-07 14:42 發表:

組合 and 巢狀 示例

原碼:
if cond then begin ........ end else begin ........ end; if cond then begin ........ end else if cond then begin ........ end else if cond then begin ........ end; if cond then begin if cond then begin ........ end; end else begin if cond then begin ........ end else begin ........ end; end;


由 abelchang 在 2011-03-07 15:13 發表:

謝謝回覆....原來是自己太死腦筋....


全部時間均為台灣時間, 現在時間為06:01
在這個頁面顯示本主題全部的 4 個文章


Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.

簡愛洋行 製作 Copyright 2003-. All Rights Reserved.