[(#ARG|oui)
calcul | recalcul
]
Choisissez la valeur à tester :
#VALEUR
#SET{arg,#ENV{arg,précisément rien}}
On teste \#SWITCH\{#GET{arg}\}
1) / \#CASE avec unique valeur entière et \#CASE_DEFAULT
#SWITCH{#GET{arg}}
[(#CASE{1}) C'est un][(#CASE{1}|non) C'est PAS un] -
[(#CASE{2}) C'est deux][(#CASE{2}|non) C'est PAS deux] -
[(#CASE{3}) C'est trois][(#CASE{3}|non) C'est PAS trois] -
[(#CASE_DEFAULT) C'est ni 1 ni 2 ni 3][(#CASE_DEFAULT|non) C'est l'un de 1, 2 ou 3]
Et de nouveau (sans nouveau switch) :
[(#CASE{1}) C'est un][(#CASE{1}|non) C'est PAS un] -
[(#CASE{2}) C'est deux][(#CASE{2}|non) C'est PAS deux] -
[(#CASE{3}) C'est trois][(#CASE{3}|non) C'est PAS trois] -
[(#CASE_DEFAULT) C'est ni 1 ni 2 ni 3][(#CASE_DEFAULT|non) C'est l'un de 1, 2 ou 3]
\#GET{_switch_}=[(#GET{_switch_})] et \#GET{_switch_matched_} ? [(#GET{_switch_matched_}|?{oui,non})].
2) / \#CASE avec plusieurs valeurs entières et \#CASE_DEFAULT
#SWITCH{#GET{arg}}
[(#CASE{1,3,5}) C'est un, trois ou cing][(#CASE{1,3,5}|non) C'est NI un NI trois NI cinq] -
[(#CASE{2,4,6}) C'est deux, quatre ou six][(#CASE{2,4,6}|non) C'est NI deux NI quatre NI six] -
[(#CASE{3,5,7}) C'est trois, cinq ou sept][(#CASE{3,5,7}|non) C'est PAS trois NI cinq NI sept] -
[(#CASE_DEFAULT) C'est pas dans 1,2,3,4,5,6,7][(#CASE_DEFAULT|non) C'est l'un de 1, 2, 3, 4, 5, 6 ou 7]
Et de nouveau (sans nouveau switch) :
[(#CASE{1,3,5}) C'est un, trois ou cing][(#CASE{1,3,5}|non) C'est NI un NI trois NI cinq] -
[(#CASE{2,4,6}) C'est deux, quatre ou six][(#CASE{2,4,6}|non) C'est NI deux NI quatre NI six] -
[(#CASE{3,5,7}) C'est trois, cinq ou sept][(#CASE{3,5,7}|non) C'est PAS trois NI cinq NI sept] -
[(#CASE_DEFAULT) C'est pas dans 1,2,3,4,5,6,7][(#CASE_DEFAULT|non) C'est l'un de 1, 2, 3, 4, 5, 6 ou 7]
\#GET{_switch_}=[(#GET{_switch_})] et \#GET{_switch_matched_} ? [(#GET{_switch_matched_}|?{oui,non})].
3) / \#CASE avec unique valeur ALPHA et \#CASE_DEFAULT
#SWITCH{#GET{arg}}
[(#CASE{A}) C'est A][(#CASE{A}|non) C'est PAS A] -
[(#CASE{B}) C'est B][(#CASE{B}|non) C'est PAS B] -
[(#CASE{C}) C'est C][(#CASE{C}|non) C'est PAS C] -
[(#CASE_DEFAULT) C'est ni A ni B ni C][(#CASE_DEFAULT|non) C'est l'un de A, B ou C]
Et de nouveau (sans nouveau switch) :
[(#CASE{A}) C'est A][(#CASE{A}|non) C'est PAS A] -
[(#CASE{B}) C'est B][(#CASE{B}|non) C'est PAS B] -
[(#CASE{C}) C'est C][(#CASE{C}|non) C'est PAS C] -
[(#CASE_DEFAULT) C'est ni A ni B ni C][(#CASE_DEFAULT|non) C'est l'un de A, B ou C]
\#GET{_switch_}=[(#GET{_switch_})] et \#GET{_switch_matched_} ? [(#GET{_switch_matched_}|?{oui,non})].
4) / \#CASE avec plusieurs valeurs ALPHA et \#CASE_DEFAULT
#SWITCH{#GET{arg}}
[(#CASE{A,B,C}) C'est A, B ou C][(#CASE{A,B,C}|non) C'est ni A ni B ni C] -
[(#CASE{B,O,F}) C'est B, O ou F][(#CASE{B,O,F}|non) C'est ni B ni O ni F] -
[(#CASE{Z,A,P}) C'est Z, A ou P][(#CASE{Z,A,P}|non) C'est ni Z ni A ni P] -
[(#CASE_DEFAULT) C'est pas dans A,B,C,F,O,P,Z][(#CASE_DEFAULT|non) C'est l'un de A,B,C,F,O,P ou Z]
Et de nouveau (sans nouveau switch) :
[(#CASE{A,B,C}) C'est A, B ou C][(#CASE{A,B,C}|non) C'est ni A ni B ni C] -
[(#CASE{B,O,F}) C'est B, O ou F][(#CASE{B,O,F}|non) C'est ni B ni O ni F] -
[(#CASE{Z,A,P}) C'est Z, A ou P][(#CASE{Z,A,P}|non) C'est ni Z ni A ni P] -
[(#CASE_DEFAULT) C'est pas dans A,B,C,F,O,P,Z][(#CASE_DEFAULT|non) C'est l'un de A,B,C,F,O,P ou Z]
\#GET{_switch_}=[(#GET{_switch_})] et \#GET{_switch_matched_} ? [(#GET{_switch_matched_}|?{oui,non})].
5) / \#CASE avec valeur ALPHA dangereuse et \#CASE_DEFAULT
#SET{arg,#ENV{arg,précisément rien}|html_entity_decode{#EVAL{ENT_QUOTES | ENT_XML1},UTF-8}}
arg html_entity_decoded : #GET{arg}
#SWITCH{#GET{arg}}
[(#CASE{A'B"C}) C'est A'B"C carrément oui][(#CASE{A'B"C}|non) C'est pas A'B"C on s'en doutait] -
[(#CASE{A'B}) C'est A'B carrément oui][(#CASE{A'B}|non) C'est pas A'B] -
[(#CASE{B"C}) C'est B"C carrément oui][(#CASE{B"C}|non) C'est pas B"C] -
[(#CASE_DEFAULT) C'est pas A'B"C ni A'B ni B"C hmm][(#CASE_DEFAULT|non) C'est A'B"C ou peut être A'B, à moins que ça ne soit B"C bendidonc]
\#GET{_switch_}=[(#GET{_switch_})] et \#GET{_switch_matched_} ? [(#GET{_switch_matched_}|?{oui,non})].