currently, I have a "log" that will keep all the text you write into it, save it, then load it back into the program the next time it's opened.
currently, my code reads like this:
vb
Dim strName As String
Dim strLog As String
Private Sub Form_Load()
strName = InputBox("enter your name or screen name", "Name?", "The loser with no name")
MsgBox "remember this name, or the log won't carry the same information", vbOKOnly, "Crypt"
lstIn.Refresh
lblIP.Caption = "your IP address is: " & socket1.LocalIP
Open CurDir & "\log\" & strName & ".dat" For Append As #2
On Error GoTo err_handler
If EOF(2) = True Then
Write #2, "anything typed here will be saved and opened at a later date. if you change your name at the beginning of chat, it will be erased."
End If
Close #2
Open "\log\" & strName & ".dat" For Input As #3
Line Input #3, strLog
Close #3
txtStore.Text = strLog
Exit Sub
err_handler:
Select Case Err.Number
Case 53: MsgBox "File Not Found"
Case 55: MsgBox "File Already Open"
Case 71: MsgBox "Disk Not Ready"
Case 76: exit sub
End Select
Resume Next
End Sub
Private Sub txtStore_Change()
Open "\log\" & strName & ".dat" For Output As #4
Write #4, strLog
Close #4
End Sub
this should create a .dat file inside a folder called log(which is already in the same directory as the .exe) containing the contents of log, and displaying them again when the program is next opened.
this should also allow multiple people to have logs, if they have different names.
now the error I'm getting is a simple error 76, file no found(at runtime).and it crashes. when it's compiled into an exe, it loads, but doesn't display the first time message. not only that, but when I change the contents of the textbox, it crashes.
I've looked inside the log folder, and there is a .dat file with my name on it, containing the first time message, so the file is their. now I just need to know what the error is.