Hi,
Simple question...I hope. I have a function below that's used to copy data to a file if a file exists, otherwise it creates it. I now need to delete the file from the source location once the copy/create has completed. Only if it successfully copied.
Here's the function:
Sub AppendToFile(SourceName As String, DestName As String)
Dim SourceHandle As Integer
SourceHandle = FreeFile
Open SourceName For Input As #SourceHandle
Dim DestHandle As Integer
DestHandle = FreeFile
Open DestName For Append As #DestHandle
Do While Not EOF(SourceHandle)
Dim SomeText As String
Line Input #SourceHandle, SomeText
Print #DestHandle, SomeText
Loop
Close #SourceHandle
Close #DestHandle
End Sub
Thanks so much for your help!
TN
Simple question...I hope. I have a function below that's used to copy data to a file if a file exists, otherwise it creates it. I now need to delete the file from the source location once the copy/create has completed. Only if it successfully copied.
Here's the function:
Sub AppendToFile(SourceName As String, DestName As String)
Dim SourceHandle As Integer
SourceHandle = FreeFile
Open SourceName For Input As #SourceHandle
Dim DestHandle As Integer
DestHandle = FreeFile
Open DestName For Append As #DestHandle
Do While Not EOF(SourceHandle)
Dim SomeText As String
Line Input #SourceHandle, SomeText
Print #DestHandle, SomeText
Loop
Close #SourceHandle
Close #DestHandle
End Sub
Thanks so much for your help!
TN