I've got the following routine in VB6:
Private Sub wsock_DataArrival(ByVal bytesTotal As Long)
Dim sItemData As String
Dim sNewFile As String
Dim lFreeFile As Long
wsock.GetData sItemData, vbString
sNewFile = App.Path & "winsock.txt"
lFreeFile = FreeFile
Open sNewFile For Output As lFreeFile
Print #lFreeFile, sItemData
On the immediate window the result of "Debug.Print sItemData" is showing up exactly as I want .However If I stop the code then restart itemswhich were collected through winsock the previuos seesion are still on the immediate window.
What I'd like to do is to write the data sItemData into a flat file clear the memory and every time the flatfile gows to let's say 100kb start a new file andrename the old.
The way I tried towrite the values from the immediate window to the f\winsock.txt file doesn't work at all.I have no ideea why.Could you please help me understand how to clear the data from the immediate window and copy it into winsock.txt then delete it.