EQV logica
esercitazione a livello
didattico elementare con visual basic su powerpoint
sintassi con variabili tipo logico
EQV
Private Sub CommandButton1_Click()
Dim x As Integer
Dim y As Integer
Lista.AddItem ("vero entrambi valori falsi o entrambi
veri")
Lista.AddItem ("falso se un valore vero e uno falso")
Lista.AddItem ("x> 0 e y>0 ...x<0 e y<0
:vero...altrimenti falso")
x = 10
y = 20
If verificaEQV(x, y) Then
Lista.AddItem ("vero " & x * y)
Else
Lista.AddItem ("falso " & x + y)
End If
End Sub
Private Sub CommandButton2_Click()
Dim x As Integer
Dim y As Integer
x = -10
y = -20
If verificaEQV(x, y) Then
Lista.AddItem ("vero " & x * y)
Else
Lista.AddItem ("falso " & x + y)
End If
End Sub
Private Sub CommandButton3_Click()
Dim x As Integer
Dim y As Integer
x = -10
y = 20
If verificaEQV(x, y) Then
Lista.AddItem ("vero " & x * y)
Else
Lista.AddItem ("falso " & x + y)
End If
End Sub
Public Function verificaEQV(x As Integer, y As Integer)
Lista.AddItem ("x=" & x & " Y=" &
y)
Lista.AddItem ("-----------------------")
If x > 0 And y > 0 Then
verificaEQV = True
Else
If x < 0 And y < 0 Then
verificaEQV = True
Else
verificaEQV = False
End If
End If
End Function
vedi eqvlogica.ppt