poik007
05-28-2003, 05:08 PM
I need a bit of help, I wanna include something that lets user open a text file with the common dialog thingy, and then it loads each line of the text file into a different variable, and I want to know how to make it create a text file, and write in it (or just write in it for that matters)
vbfan
05-29-2003, 02:23 AM
1) CommonDialog.showopen to open the CommonDialog for open
2) To save all in a different Var I would do this with an Array.
FF = FreeFile
Dim linenr as integer
dim lines() as String
open CommonDialog.FileName for Input As #FF
Line input #ff, lines(0)
linenr = 0
Do While not EOF(FF)
linenr = linenr + 1
Line Input #FF, lines(linenr)
loop
3) to save it you can use the CommonDialog again:
CommonDialog.showsave
Open .filename for Output as #FF
For line=0 to Ubound(lines())
Print #FF, lines(line)
Next line
Close 'FF