恪別𡧲版𢯢𢷮𧵑「板㑄:Qif」
交面
Trong Dang (討論 | 㨂𢵰) 造張㵋貝內容「<noinclude> __NOTOC__ ==Câu thường hỏi== ===Bản mẫu này dùng để làm gì?=== Bạn có thể sử dụng bản mẫu này để bắt chước cấu trúc <code>if...else</code> của những ngôn ngữ lập trình thật. '''Bản mẫu này đã được thay thế bằng hàm cú pháp <code>#if:</code>.''' ===Tôi sử dụng nó như thế nào?=== <nowiki> {{qif |test=GIÁ-TR…」 𥮋:𢯢𢷮移動 Mobile web edit Advanced mobile edit |
Trong Dang (討論 | 㨂𢵰) 空固縿略𢯢𢷮 𥮋:𢯢𢷮移動 Mobile web edit Advanced mobile edit |
||
| (空顯示4番版於𡧲𧵑共𠊛用) | |||
| 𣳔2: | 𣳔2: | ||
__NOTOC__ | __NOTOC__ | ||
== | ==句常𠳨== | ||
=== | ===板㑄尼用抵𫜵之?=== | ||
伴固体使用[[韋那威其:板㑄|板㑄]]尼抵扒着構築 <code>if...else</code> 𧵑仍[[言語立程]]實。'''板㑄尼㐌得𠊝替憑[[Trợ giúp:Tính toán##if|函句法 <code>#if:</code>]]。''' | |||
=== | ===碎使用伮如勢𱜢?=== | ||
<nowiki> | <nowiki> | ||
{{qif | {{qif | ||
|test= | |test=價值抵㧗 | ||
|then= | |then=文本抵顯示裊結果空𥧪(固体包𠁟價值抵㧗) | ||
|else= | |else=文本抵顯示裊伮𥧪 | ||
}}</nowiki> | }}</nowiki> | ||
* | *空扒𫃚定參數 <code>else</code>。 | ||
* | *空定𤑟結果裊參數 <code>test</code> 吧/或 <code>then</code> 空得定𫥨。 | ||
* | *拱空定𤑟結果裊參數恪貝 <code>test</code>、 <code>then</code>、吧 <code>else</code> 得定𫥨。 | ||
* | *板㑄尼空活動貝詞銙 <code>subst:</code>。 | ||
=== | ===譬喻=== | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! 碼源 !! 結果 | ||
|- | |- | ||
| | | | ||
| 𣳔77: | 𣳔77: | ||
|} | |} | ||
== | ==䀡添== | ||
*{{tl|spif}} | *{{tl|spif}} | ||
*{{tl|if}} | *{{tl|if}} | ||
版㵋一𣅶13:24、𣈜22𣎃8𢆥2025
句常𠳨
板㑄尼用抵𫜵之?
伴固体使用板㑄尼抵扒着構築 if...else 𧵑仍言語立程實。板㑄尼㐌得𠊝替憑函句法 #if:。
碎使用伮如勢𱜢?
{{qif
|test=價值抵㧗
|then=文本抵顯示裊結果空𥧪(固体包𠁟價值抵㧗)
|else=文本抵顯示裊伮𥧪
}}
- 空扒𫃚定參數
else。 - 空定𤑟結果裊參數
test吧/或then空得定𫥨。 - 拱空定𤑟結果裊參數恪貝
test、then、吧else得定𫥨。 - 板㑄尼空活動貝詞銙
subst:。
譬喻
| 碼源 | 結果 |
|---|---|
{{qif
|test={{boolne|foo|bar}}
|then=true
|else=false
}}
|
true |
{{qif
|test={{booleq|foo|bar}}
|then=true
|else=false
}}
|
true |
{{qif
|test=
|then=bar
}}
|
|
{{qif
|test=foo
|then=bar
}}
|
bar |
䀡添
- {{spif}}
- {{if}}
- {{if defined}}
- {{switch}}