Selezione singola |
 |
|
... If E = 1 Then Istr_11 Istr_12 EndIf ... |
|
Selezione doppia |
 |
|
... If E = 1 Then Istr_11 Istr_12 Else Istr_21 Istr_22 EndIf ... |
|
Selezione tripla
|
 |
|
... If E = E1 Then Istr_11 Istr_12 Else If E = E2 Then Istr_21 Istr_22 Else Istr_31 Istr_32 EndIf EndIf ... |
|
Selezioni annidate
|
 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
... If A > 0 Then If B > 0 Then Istr_11 Istr_12 Else Istr_21 Istr_22 EndIf Else If C > 0 Then Istr_31 Istr_32 Else Istr_41 Istr_42 EndIf EndIf ... |
|
|
 |
|
... If A > 0 Then If B > 0 Then Istr_11 Istr_12 Else Istr_11 Istr_12 EndIf EndIf ... |
|
|
 |
|
... If A > 0 Then If B > 0 Then Istr_11 Istr_12 EndIf Else Istr_11 Istr_12 EndIf ... |
|
Selezione multipla
|
 |
|
... If E = E1 Then Istr_11 Istr_12 ElseIf E = E2 Then Istr_21 Istr_22 ... ... Else Istr_n1 Istr_n2 EndIf ... |
|
|
 |
|
... If E = E1 Then Istr_11 Istr_12 ElseIf E = E2 Then Istr_21 Istr_22 ... ... ElseIf E = En Then Istr_n1 Istr_n2 EndIf ... |
|
In molti casi puoi semplificare un blocco costituito da selezioni annidate con una selezione multipla ed espressioni logiche più complicate
Da … |
a … |
|
If A > 0 Then ... Else If A = 0 Then ... Else ... EndIf EndIf |
|
|
If A > 0 Then ... ElseIf A = 0 Then ... Else ... EndIf |
|
|
If A <> 0 Then ... Else If B = 0 Then ... Else ... EndIf EndIf |
|
|
If A <> 0 Then ... ElseIf B = 0 Then ... Else ... EndIf |
|
|
If DELTA > 0 Then ... Else If DELTA = 0 Then ... Else ... EndIf EndIf |
|
|
If DELTA > 0 Then ... ElseIf DELTA = 0 then ... Else ... EndIf |
|