Open "C:\MonFichier.txt" For Output As #1
Dim chaine as string
chaine = "!R! FRPO L1," & Textbox1.text
chaine = chaine & "; FRPO L2," & Textbox2.text
chaine = chaine & "; FRPO L3," & Textbox3.text
chaine = chaine & "; FRPO L4," & Textbox4.text
chaine = chaine & "; STAT1; EXIT;"
Print #1, chaine
Kill "C:\MonFichier.txt"
Private Sub Combo1_Click()
MsgBox "STAT" & Combo1.List(Combo1.ListIndex)
End Sub
Private Sub cmdEnregistrer_Click()
Dim texte
texte = Text1.Text
Open "C:\MonFichier.txt" For Output As #1
Print #1, texte
Close #1
Private Sub cmdLireEnreg_Click()
Dim crlf, tout, texte
On Error Resume Next
crlf = Chr(13) + Chr(10)
Open "C:\MonFichier.txt" For Input As #1
Line Input #1, texte
tout = texte
If Len(tout) <> 0 Then
While Not EOF(1)
Line Input #1, texte
tout = tout + crlf + texte
Wend
End If
Text1.Text = tout
Close #1
End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub cmdEnregistrer_Click()
Dim L1, L2, L3, L4
L1 = L1.Text
L2 = L2.Text
L3 = L3.Text
L4 = L4.Text
Open "C:\MonFichier.txt" For Output As #1
Print #1, L1
Print #1, L2
Print #1, L3
Print #1, L4
Close #1
End Sub
Private Sub cmdLireEnreg_Click()
Dim crlf, Enreg_L1, Enreg_L2, Enreg_L3, Enreg_L4, L1,L2,L3,L4
On Error Resume Next
crlf = Chr(13) + Chr(10)
Open "C:\MonFichier.txt" For Input As #1
Line Input #1,L1
Line Input #1,L2
Line Input #1,L3
Line Input #1,L4
Enreg_L1=L1
Enreg_L2 =L2
Enreg_L3 =L3
Enreg_L4 =L4
If Len(tout) <> 0 Then
While Not EOF(1)
Line Input #1,L1
Enreg_L1= Enreg_L1+ crlf +L1
Wend
If Len(Enreg_L2) <> 0 Then
While Not EOF(1)
Line Input #1,L2
Enreg_L2 = Enreg_L2 + crlf +L2
Wend
If Len(Enreg_L3) <> 0 Then
While Not EOF(1)
Line Input #1,L3
Enreg_L3 = Enreg_L3 + crlf +L3
Wend
If Len(Enreg_L4) <> 0 Then
While Not EOF(1)
Line Input #1,L4
Enreg_L4 = Enreg_L4 + crlf +L4
Wend
End If
End If
End If
End If
L1.Text = Enreg_L1
L2.Text = Enreg_L2
L3.Text = Enreg_L3
L4.Text = Enreg_L4
Close #1
End Sub
Private Sub Command1_Click()
Open "C:\MonFichier.txt" For Output As #1
Dim chaine As String
chaine = "!R! FRPO L1," & Textbox1.Text
chaine = chaine & "; FRPO L2," & Textbox2.Text
chaine = chaine & "; FRPO L3," & Textbox3.Text
chaine = chaine & "; FRPO L4," & Textbox4.Text
chaine = chaine & "; STAT1; EXIT;"
Print #1, chaine
Close #1
End Sub
Private Sub Form_Load()
Open "C:\MonFichier.txt" For Output As #1
Close #1
End Sub
Open "C:\MonFichier.txt" For Output As #1
Close #1
Private Sub Form_Load()
combo1.AddItem "0"
combo1.AddItem "1"
End Sub
private sub combo1_click()
if combo1.listindex = 0 then
msgbox "STAT0"
elseif combo1.listindex = 1 then
msgbox "STAT1"
end if
chaine = chaine & "; STAT" & Combo1.List(Combo1.ListIndex)
chaine = chaine & "; EXIT;"
Private Sub Command1_Click()
if Combo1.Listindex = -1 then
msgbox "valeur STAT non précisée":Exit Sub
end if
Open "C:\MonFichier.txt" For Output As #1
Dim chaine As String
chaine = "!R! FRPO L1," & Textbox1.Text
chaine = chaine & "; FRPO L2," & Textbox2.Text
chaine = chaine & "; FRPO L3," & Textbox3.Text
chaine = chaine & "; FRPO L4," & Textbox4.Text
chaine = chaine & "; STAT" & Combo1.List(Combo1.ListIndex)&";EXIT;"
Print #1, chaine
Close #1
End Sub
Private Sub Combo1_Click()
Open "C:\MonFichier.txt" For Output As #1
Dim chaine As String
chaine = "!R! FRPO L1," & Textbox1.Text
chaine = chaine & "; FRPO L2," & Textbox2.Text
chaine = chaine & "; FRPO L3," & Textbox3.Text
chaine = chaine & "; FRPO L4," & Textbox4.Text
chaine = chaine & "; STAT" & Combo1.List(Combo1.ListIndex)&";EXIT;"
Print #1, chaine
Close #1
End Sub