Explication par l'exemple, comment arriver au résultat de l'exemple 2 sans utiliser une condition :
Exemple 1 - Code faux
Code : Tout sélectionner
#Const1=1
#Const2=2
#Const3=4
#Const4=8
#Const5=16
#Const6=32
#Const7=64
#Const8=128
#Const9=256
#Const10=512
#Const11=1024
#Const12=2048
#Const13=4096
#Const14=8192
#Const15=16384
#Const16=32768
#Const17=65536
For i = 0 To Random(8000)
hObject | #Const1
hObject | #Const2
hObject | #Const3
hObject | #Const4
hObject | #Const5
hObject | #Const6
hObject | #Const7
hObject | #Const8
hObject | #Const9
hObject | #Const10
hObject | #Const11
hObject | #Const12
hObject | #Const13
hObject | #Const14
hObject | #Const15
hObject | #Const16
hObject | #Const17
Next
For i = 0 To Random(8000)
hObject - #Const1
hObject - #Const2
hObject - #Const3
hObject - #Const4
hObject - #Const5
hObject - #Const6
hObject - #Const7
hObject - #Const8
hObject - #Const9
hObject - #Const10
hObject - #Const11
hObject - #Const12
hObject - #Const13
hObject - #Const14
hObject - #Const15
hObject - #Const16
hObject - #Const17
Next
Debug hObject
Code : Tout sélectionner
#Const1=1
#Const2=2
#Const3=4
#Const4=8
#Const5=16
#Const6=32
#Const7=64
#Const8=128
#Const9=256
#Const10=512
#Const11=1024
#Const12=2048
#Const13=4096
#Const14=8192
#Const15=16384
#Const16=32768
#Const17=65536
For i = 0 To Random(8000)
hObject | #Const1
hObject | #Const2
hObject | #Const3
hObject | #Const4
hObject | #Const5
hObject | #Const6
hObject | #Const7
hObject | #Const8
hObject | #Const9
hObject | #Const10
hObject | #Const11
hObject | #Const12
hObject | #Const13
hObject | #Const14
hObject | #Const15
hObject | #Const16
hObject | #Const17
Next
For i = 0 To Random(8000)
If hObject & #Const1 : hObject - #Const1 : EndIf
If hObject & #Const2 : hObject - #Const2 : EndIf
If hObject & #Const3 : hObject - #Const3 : EndIf
If hObject & #Const4 : hObject - #Const4 : EndIf
If hObject & #Const5 : hObject - #Const5 : EndIf
If hObject & #Const6 : hObject - #Const6 : EndIf
If hObject & #Const7 : hObject - #Const7 : EndIf
If hObject & #Const8 : hObject - #Const8 : EndIf
If hObject & #Const9 : hObject - #Const9 : EndIf
If hObject & #Const10 : hObject - #Const10 : EndIf
If hObject & #Const11 : hObject - #Const11 : EndIf
If hObject & #Const12 : hObject - #Const12 : EndIf
If hObject & #Const13 : hObject - #Const13 : EndIf
If hObject & #Const14 : hObject - #Const14 : EndIf
If hObject & #Const15 : hObject - #Const15 : EndIf
If hObject & #Const16 : hObject - #Const16 : EndIf
If hObject & #Const17 : hObject - #Const17 : EndIf
Next
Debug hObject
LHS | RHS |Résultat
------------------
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1
Merci.