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
|
Private Sub Form_Load()
Set Récup = New RécupInfos
Set liaison = New Mlan
Set Récup.liais = liaison
End Sub
Private Sub Timer1_Timer()
'Command2.Enabled = False
StatusBar1.SimpleText = "Récupération en cours..."
Dim i, var As Integer
Dim val, typ As String
Dim Rapports(2) As Double
données_récup = Récup.Récupération
If données_récup(4)(0) <> 1 Then
Command2.Enabled = True
StatusBar1.SimpleText = "Erreur de communication à la commande n°" & données_récup(4)(0)
var = MsgBox(StatusBar1.SimpleText, vbOKOnly, "Erreur")
Exit Sub
End If
For i = 0 To UBound(données_récup(0))
Text1(i).Text = données_récup(0)(i) & " %"
Select Case données_récup(1)(i)
Case 0
typ = "Aucun"
Case 1
typ = "Rebroyé"
Case 2
typ = "Naturel"
Case 3
typ = "Additif/Colorant"
End Select
Text4(i).Text = typ
Text2(i).Text = données_récup(2)(i) & " gr"
Next
For i = 0 To UBound(données_récup(3))
Text3(i).Text = données_récup(3)(i) & " %"
Rapports(i) = données_récup(3)(i)
Next
'Texte rajouté pour le stockage
Dim fileNumer As Integer
FileNumber = FreeFile
'Ouvre le fichier
open "c:\test.txt" For append As #FileNumber
'Lit la première ligne et la place dans Var1
'Ferme le fichier
Close #FileNumber
'App.TaskVisible = True
Var1 = Text4(0).Text
Var2 = Text1(0).Text
Var3 = Text2(0).Text
Var4 = Text4(1).Text
Var5 = Text1(1).Text
Var6 = Text2(1).Text
Var7 = Text4(2).Text
Var8 = Text1(2).Text
Var9 = Text2(2).Text
Var10 = Text4(3).Text
Var11 = Text1(3).Text
Var12 = Text2(3).Text
Var13 = Text3(0).Text
Var14 = Text3(1).Text
Var15 = Text3(2).Text
Var16 = Text6.Text
Print #FileNumber, Var1, Var2, Var3
Print #FileNumber, Var4, Var5, Var6
Print #FileNumber, Var7, Var8, Var9
Print #FileNumber, Var10, Var11, Var12
Print #FileNumber, Var13, Var14, Var15
Print #FileNumber, Var16
Close #FileNumber |
Partager