ant
August 19th, 2001, 09:29 AM
I have this code in a form:
private Sub Command1_Click()
on error resume next
d.Filter = "TextFiles |*.txt|"
d.ShowSave
Open d.filename for Output as #1
print #1, b.Text
Close #1
e.Filter = "TextFiles |*.txt|"
e.ShowSave
Open e.filename for Output as #1
print #1, c.Text
Close #1
f.Filter = "Testfile |*.txp|"
f.ShowSave
Open f.filename for Output as #1
print #1, d.filename & Chr(10) & e.filename & Chr(10)
Close #1
End Sub
private Sub Command2_Click()
on error resume next
f.Filter = "Text Projects |*.txp|"
f.ShowOpen
Open f.filename for input as #1
Line input #1, txt
a2.Text = txt
Line input #2, txt2
a3.Text = txt2
b2.LoadFile a2.Text
c.LoadFile txt
End Sub
What it's supposed to do is load 1 file. Seperate the 2 lines from the file into 2 seperate textboxes. Then in the textboxes, it reads the text from the textbox and opens the file from the path in the textbox. THe file is supposed to be opened into another textbox. The second textbox is supposed to do the same thing, except load a different file.
But when i run it, it only reads 1 line, and only loads 1 file. What am i doing wrong?
PS The *.txp file looks like this:
C:\test\000test\a.txt
C:\test\000test\b.txt
--Ant
--------------------------------------------------
Create rollover effects in no time!, visit:
http://members.fortunecity.com/ants12/rolloverwiz.html
Or email me:
christopherfolger@hotmail.com
private Sub Command1_Click()
on error resume next
d.Filter = "TextFiles |*.txt|"
d.ShowSave
Open d.filename for Output as #1
print #1, b.Text
Close #1
e.Filter = "TextFiles |*.txt|"
e.ShowSave
Open e.filename for Output as #1
print #1, c.Text
Close #1
f.Filter = "Testfile |*.txp|"
f.ShowSave
Open f.filename for Output as #1
print #1, d.filename & Chr(10) & e.filename & Chr(10)
Close #1
End Sub
private Sub Command2_Click()
on error resume next
f.Filter = "Text Projects |*.txp|"
f.ShowOpen
Open f.filename for input as #1
Line input #1, txt
a2.Text = txt
Line input #2, txt2
a3.Text = txt2
b2.LoadFile a2.Text
c.LoadFile txt
End Sub
What it's supposed to do is load 1 file. Seperate the 2 lines from the file into 2 seperate textboxes. Then in the textboxes, it reads the text from the textbox and opens the file from the path in the textbox. THe file is supposed to be opened into another textbox. The second textbox is supposed to do the same thing, except load a different file.
But when i run it, it only reads 1 line, and only loads 1 file. What am i doing wrong?
PS The *.txp file looks like this:
C:\test\000test\a.txt
C:\test\000test\b.txt
--Ant
--------------------------------------------------
Create rollover effects in no time!, visit:
http://members.fortunecity.com/ants12/rolloverwiz.html
Or email me:
christopherfolger@hotmail.com