Siegie
05-01-2003, 05:22 AM
hi all
i have a problem with following code:
Sub CreateFile()
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(CommonDialog1.FileName & ".txt", True)
tf.writeline (Val(Text1.Text))
tf.writeline (Val(Text2.Text))
tf.writeline (Val(Text3.Text))
tf.writeline (Val(Text4.Text))
tf.Close
End Sub
Sub OpenFile()
Dim zt, z_fso
Set z_fso = CreateObject("Scripting.FileSystemObject")
Set z_t = z_fso.OpenTextFile(CommonDialog1.FileName, 1, False)
Text1 = Val(z_line1)
Text2 = Val(z_line2)
Text3 = Val(z_line3)
Text4 = Val(z_line4)
End Sub
Private Sub cmdSave_Click()
CommonDialog1.ShowSave
CreateFile
End Sub
Private Sub cmdOpen_Click()
CommonDialog1.ShowOpen
OpenFile
End Sub
at first, i save the contents of a textbox (numbers only) in a *.txt-file and then, i want to load the saved numbers.
my problem is that the loaded numbers are 0 (zero) and not the numbers i saved.
how can i solve this problem?
thank you all
regards
siegie
ps: sorry 4 my bad english
i have a problem with following code:
Sub CreateFile()
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(CommonDialog1.FileName & ".txt", True)
tf.writeline (Val(Text1.Text))
tf.writeline (Val(Text2.Text))
tf.writeline (Val(Text3.Text))
tf.writeline (Val(Text4.Text))
tf.Close
End Sub
Sub OpenFile()
Dim zt, z_fso
Set z_fso = CreateObject("Scripting.FileSystemObject")
Set z_t = z_fso.OpenTextFile(CommonDialog1.FileName, 1, False)
Text1 = Val(z_line1)
Text2 = Val(z_line2)
Text3 = Val(z_line3)
Text4 = Val(z_line4)
End Sub
Private Sub cmdSave_Click()
CommonDialog1.ShowSave
CreateFile
End Sub
Private Sub cmdOpen_Click()
CommonDialog1.ShowOpen
OpenFile
End Sub
at first, i save the contents of a textbox (numbers only) in a *.txt-file and then, i want to load the saved numbers.
my problem is that the loaded numbers are 0 (zero) and not the numbers i saved.
how can i solve this problem?
thank you all
regards
siegie
ps: sorry 4 my bad english