•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,492 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,685 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1050 | Replies: 1
![]() |
•
•
Join Date: Sep 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
I made this code, and it does the job. But it doesn't make a new file when I check and uncheck the checkbox. I can only make one log, then I need to restart my program, to make a new log.
Private Sub sckUDP_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
If Err Then MsgBox Error$, 48
Dim filelocation As String
Dim strData As String
sckUDP.GetData strData 'Retrieve the data
txtReceive.Text = strData 'Display it
If chkLog = 1 Then
filelocation = "UDP_Log" & "-" & Format(Now, "yyyymmdd hhmmss") & ".txt"
Open filelocation For Append As #1
Print #1, txtReceive.Text
If chkLog = 0 Then
Close #1
End If
End If
End Sub
Private Sub sckUDP_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
If Err Then MsgBox Error$, 48
Dim filelocation As String
Dim strData As String
sckUDP.GetData strData 'Retrieve the data
txtReceive.Text = strData 'Display it
If chkLog = 1 Then
filelocation = "UDP_Log" & "-" & Format(Now, "yyyymmdd hhmmss") & ".txt"
Open filelocation For Append As #1
Print #1, txtReceive.Text
If chkLog = 0 Then
Close #1
End If
End If
End Sub
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Save number to a file (Python)
- Please help with data file and array (C++)
- Help creating a data file (C)
- input data from a file into an Array (C)
- Reading from external data file (C++)
- data file help (C)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 ControlBox position
- Next Thread: Need to connect to a port using vb6.0.


Linear Mode