onerrorgoto
Nov 25th, 1999, 09:26 PM
Hello World :)
I'm not that good at errorhandling yet,
but why doesn't this work?
I call this sub att form load.
I get "Error 53 file doesn't exist" all the time and that is correct because the file doesn't exist yet.
The user have to run the program once to create the file. should I create the file at form load or something to prevent this.
Private Sub ReadFromFile()
Dim strTemp As String
Dim strX As String
On Error GoTo ErrorHandling
Open App.Path & "\Recent.txt" For Input As #1
Do While strTemp <> "[END]"
Line Input #1, strTemp
If strTemp <> "[END]" Then cboSentMessages.AddItem strTemp
Loop
Close #1
Exit Sub
ErrorHandling:
End Sub
------------------
On Error Goto Bed :)
anders@zsystemdesign.se
I'm not that good at errorhandling yet,
but why doesn't this work?
I call this sub att form load.
I get "Error 53 file doesn't exist" all the time and that is correct because the file doesn't exist yet.
The user have to run the program once to create the file. should I create the file at form load or something to prevent this.
Private Sub ReadFromFile()
Dim strTemp As String
Dim strX As String
On Error GoTo ErrorHandling
Open App.Path & "\Recent.txt" For Input As #1
Do While strTemp <> "[END]"
Line Input #1, strTemp
If strTemp <> "[END]" Then cboSentMessages.AddItem strTemp
Loop
Close #1
Exit Sub
ErrorHandling:
End Sub
------------------
On Error Goto Bed :)
anders@zsystemdesign.se