
Public Ierror As Integer Sub Base() Ierror = 0 Call Sub A If Ierror = 100 then Goto finito Else Goto continua End If continua: Call Sub B If Ierror = 100 then Goto finito Else ...< fai qualcosa ..> End If finito: End Sub --------------- Sub A Call Sub Pera If Ierror = 100 then Goto smetti Else ...< fai qualcosa ..> End If smetti: End Sub ------------- Sub B Call Sub Mela If Ierror = 100 then Goto basta Else ...< fai qualcosa ..> End If basta: End Sub |
Public Ierror As Integer
Sub Base()
Ierror = 0
Call A
If Ierror = 100 Then
GoTo finito
Else
GoTo continua
End If
continua:
Call B
If Ierror = 100 Then
GoTo finito
Else
MsgBox "Messaggio della macro 'BASE'"
End If
finito:
End Sub
'---------------
Sub A()
Call pera
If Ierror = 100 Then
GoTo smetti
Else
MsgBox "Messaggio della macro 'A'"
End If
smetti:
End Sub
'-------------
Sub B()
Call mela
If Ierror = 100 Then
GoTo basta
Else
MsgBox "Messaggio della macro 'B'"
End If
basta:
End Sub
Sub mela()
End Sub
Sub pera()
Ierror = 100
MsgBox "La macro 'pera' ha impostato a: " & Ierror & " - la variabile 'Ierror'"
End Sub |
