Private Const homme = 1, femme = 2, diabete = 4, medic = 8, chirurgie = 16, gueri = 32, recidive = 64
Private patient As Byte
Private Sub CommandButton1_Click()
patient = femme Or medic Or chirurgie Or gueri
MsgBox "ce patient est-il est-il gueri ? " & voyons(patient, gueri)
MsgBox "ce patient a-t-il subi une chirurgie ? " & voyons(patient, chirurgie)
MsgBox "ce patient est-il diabétique ? " & voyons(patient, diabete)
MsgBox "ce patient est-il un homme ? " & voyons(patient, homme)
MsgBox "ce patient est-il une femme ? " & voyons(patient, femme)
End Sub
Private Function voyons(patient As Byte, OBJ As Byte) As Boolean
toto = patient And OBJ
voyons = toto = OBJ
End Function