Gambas France BETA


Pas de compte ? Incription

Alcoolemie

À propos de ce code

Mesurer son taux d'alcool dans le sang avec plusieurs facteurs (poids, sexe, repas, consommation, corpulence)

Code source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
' Gambas class file

STATIC A AS FLOAT ' Consommation biere
STATIC B AS FLOAT ' Consommation aperitif
STATIC C AS FLOAT ' Consommation vin
STATIC D AS FLOAT ' Consommation alcool fort
STATIC E AS FLOAT ' Total des consommations
STATIC S AS FLOAT ' variable alcool
STATIC P AS BYTE ' Poids
STATIC T AS FLOAT ' Taux

PUBLIC SUB _new()
S = 0.7
P = 70
END

PUBLIC SUB Form_Open()

END

PUBLIC FUNCTION Alcoolemie()
E = A + B + C + D
IF RadioButton1.Value = TRUE AND RadioButton3.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.61 ' Homme Mince Ajeun
IF RadioButton1.Value = TRUE AND RadioButton4.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.70 ' Homme Normal Ajeun
IF RadioButton1.Value = TRUE AND RadioButton5.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.80 ' Homme Fort Ajeun
IF RadioButton1.Value = TRUE AND RadioButton3.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.65 ' Homme Mine Ajeun
IF RadioButton1.Value = TRUE AND RadioButton4.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.74 ' Homme Mine Ajeun
IF RadioButton1.Value = TRUE AND RadioButton5.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.84 ' Homme Mine Ajeun
IF RadioButton2.Value = TRUE AND RadioButton3.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.51 ' Homme Mince Ajeun
IF RadioButton2.Value = TRUE AND RadioButton4.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.60 ' Homme Normal Ajeun
IF RadioButton2.Value = TRUE AND RadioButton5.Value = TRUE AND RadioButton7.Value = TRUE THEN S = 0.70 ' Homme Fort Ajeun
IF RadioButton2.Value = TRUE AND RadioButton3.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.55 ' Homme Mine Ajeun
IF RadioButton2.Value = TRUE AND RadioButton4.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.64 ' Homme Mine Ajeun
IF RadioButton2.Value = TRUE AND RadioButton5.Value = TRUE AND RadioButton6.Value = TRUE THEN S = 0.74 ' Homme Mine Ajeun
T = (E * 0.789) / (S * P) ' Formule alcoolemie
Label13.Text = Round(T, -2) & " g/l" ' Affichage du taux
END

PUBLIC SUB SpinBox2_Change()
A = (SpinBox2.Value * (SpinBox3.Value * 10)) * (SpinBox4.Value / 100)
END

PUBLIC SUB SpinBox3_Change()
A = (SpinBox2.Value * (SpinBox3.Value * 10)) * (SpinBox4.Value / 100)
END

PUBLIC SUB SpinBox4_Change()
A = (SpinBox2.Value * (SpinBox3.Value * 10)) * (SpinBox4.Value / 100)
END

PUBLIC SUB SpinBox5_Change()
B = (SpinBox5.Value * (SpinBox6.Value * 10)) * (SpinBox7.Value / 100)
END

PUBLIC SUB SpinBox6_Change()
B = (SpinBox5.Value * (SpinBox6.Value * 10)) * (SpinBox7.Value / 100)
END

PUBLIC SUB SpinBox7_Change()
B = (SpinBox5.Value * (SpinBox6.Value * 10)) * (SpinBox7.Value / 100)
END

PUBLIC SUB SpinBox8_Change()
C = (SpinBox8.Value * (SpinBox9.Value * 10)) * (SpinBox10.Value / 100)
END

PUBLIC SUB SpinBox9_Change()
C = (SpinBox8.Value * (SpinBox9.Value * 10)) * (SpinBox10.Value / 100)
END

PUBLIC SUB SpinBox10_Change()
C = (SpinBox8.Value * (SpinBox9.Value * 10)) * (SpinBox10.Value / 100)
END

PUBLIC SUB SpinBox11_Change()
D = (SpinBox11.Value * (SpinBox12.Value * 10)) * (SpinBox13.Value / 100)
END

PUBLIC SUB SpinBox12_Change()
D = (SpinBox11.Value * (SpinBox12.Value * 10)) * (SpinBox13.Value / 100)
END

PUBLIC SUB SpinBox13_Change()
D = (SpinBox11.Value * (SpinBox12.Value * 10)) * (SpinBox13.Value / 100)
END

PUBLIC SUB SpinBox1_Change()
P = SpinBox1.Value
END

PUBLIC SUB Button1_Click()
Alcoolemie()
END

Commentaires

Commentaire de gambix, Le 16/7/2011 à 20:02:00
Test :)