I have the following code to write a filename (which is passed from elsewhere) to the top line (I guess by making a new line) of a dat file leaving the rest of its contents untouched. This code puts the filename there but seems just to be making a new file as the contents of the original file dissapear.
Function WriteLineToFile(filename)
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fs
penTextFile(DATA_PATH & filename, ForWriting, False)
f.WriteLine filename
End Function
Can you help?
Function WriteLineToFile(filename)
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fs
f.WriteLine filename
End Function
Can you help?