Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

And avec Or

4 réponses
Avatar
j0b
Bonsoir à tous, j'ai une conditionnelle mais j'aimerais bien associer un and
avec or, comme :

if textbox1.Value = "" or (textbox2.value = "" and textbox3.value = "") then
else....
End if

Mais je ne vois pas comme l'écrire. Merci bien

4 réponses

Avatar
FxM
Bonsoir,

Pour ce qui est de l'écriture, tel que tu l'as fait peut être ok.
Pour ce qui est de la logique et/ou tout dépend de ce que tu cherches.
La position des parenthèses joue énormément.

faux AND faux = faux
faux AND vrai = faux
vrai AND faux = faux
vrai AND vrai = vrai

faux OR faux = faux
faux OR vrai = vrai
vrai OR faux = vrai
vrai OR vrai = vrai

vrai OR (faux AND vrai) = vrai
(vrai OR faux) AND vrai = vrai
vrai OR (vrai AND faux) = vrai
(vrai OR vrai) AND faux = faux

@+
FxM



Bonsoir à tous, j'ai une conditionnelle mais j'aimerais bien associer un and
avec or, comme :

if textbox1.Value = "" or (textbox2.value = "" and textbox3.value = "") then
else....
End if

Mais je ne vois pas comme l'écrire. Merci bien


Avatar
lSteph
j0b a pensé très fort :
Bonsoir à tous, j'ai une conditionnelle mais j'aimerais bien associer un and
avec or, comme :

if textbox1.Value = "" or (textbox2.value = "" and textbox3.value = "") then
else....
End if

Mais je ne vois pas comme l'écrire. Merci bien


--
- -

Avatar
LE TROLL
Bonsoir,

A priori c'est bon ce que tu as fait:

if condition2 OR (condition2 AND condition3) then: commande...

--
Merci beaucoup, au revoir et à bientôt :o)
------
Site éditeur MES ROMANS édités
http://www.manuscritdepot.com/a.joseph-attila-pusztay.1.htm
Site de MES LOGICIELS
http://irolog.free.fr
mon adresse EMail
http://irolog.free.fr/ecrire/index.htm
------------------------------------------------------------------------------------
"j0b" a écrit dans le message de news:

Bonsoir à tous, j'ai une conditionnelle mais j'aimerais bien associer un
and
avec or, comme :

if textbox1.Value = "" or (textbox2.value = "" and textbox3.value = "")
then
else....
End if

Mais je ne vois pas comme l'écrire. Merci bien


Avatar
j0b
Ah ben si vous confirmez je vais refaire un test mais j'avais un débogage
tout a l heure peut etre parce que j'avais encore rajouter un or derrière et
peut etre que j'ai oublié un underscor, je vais voir ca, mais en tout cas
merci et pardon pour le dérangement


Bonsoir,

A priori c'est bon ce que tu as fait:

if condition2 OR (condition2 AND condition3) then: commande...

--
Merci beaucoup, au revoir et à bientôt :o)
------
Site éditeur MES ROMANS édités
http://www.manuscritdepot.com/a.joseph-attila-pusztay.1.htm
Site de MES LOGICIELS
http://irolog.free.fr
mon adresse EMail
http://irolog.free.fr/ecrire/index.htm
------------------------------------------------------------------------------------
"j0b" a écrit dans le message de news:

Bonsoir à tous, j'ai une conditionnelle mais j'aimerais bien associer un
and
avec or, comme :

if textbox1.Value = "" or (textbox2.value = "" and textbox3.value = "")
then
else....
End if

Mais je ne vois pas comme l'écrire. Merci bien