在條件事選擇的時候,通常可以用幾種選擇性結構進行判斷
在php中 if 條件式是這麼下的
if (a!=0){
做什麼事;}else{
做另一件事;
}
如此一來,完成一個選擇性的結構
在delphi中,法語有一些些的不同,在if..than…else的結構中,不能放;(if條件句結束),如果要放;,只能加在begin…end中
下面是做按鈕的開關sample
If Edit1.Text=” Then
Button1.Enable:=false
Else
Button1.Enable:=true; <—最後要加分號做結束
多內容的If…Then…Else語法
If Edit1.Text=” Then
begin
Button1.Enable:=false;
Button2.Enable:=false;
Button3.Enable:=false;
end <—第1個End 不加 ; 最後一個End 才加;
Else
begin
Button1.Enable:=true;
Button2.Enable:=true;
Button3.Enable:=true;
end
;
隨機文章
- 請給我 ffmpeg 參數 轉換寬度最高1920px h.265 編碼 使用字幕檔 (2024-09-22)
- 養生堅果開箱文 (2011-11-29)
- 機車老外 讓我氣的想罵髒話 (2010-02-19)
- 腦殘的衛生署?現在署長是哪位? (2012-04-13)
- maillog中出現calmav無法更新的訊息 (2010-03-06)








