Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with errorhandling

Status
Not open for further replies.

ThaVolt

Programmer
Aug 12, 2002
34
NL
Hi i want my program to open a logfile at start wich is no problem but if the file doesn't exist it will be created on close so the error isn't bad but i want to make my status bar say: "Log file not found, automatically created" but even when there is a log file the status bar still says: "Log file not found, automatically created" do i miss something here?

Private Sub Form_Load()
StatusBar1.SimpleText = "Ready"
On Error GoTo Errorhandler
Open App.Path & "\logfile.Log" For Input As #1
Do Until EOF(1)
Line Input #1, variablename
List1.AddItem variablename
Loop
Close #1
Winsock1.Listen
Errorhandler:
StatusBar1.SimpleText = "Log file not found, automatically created"
End Sub

Hope u guys can help me out

Greetings
 

if dir(App.Path & "\logfile.Log") = "" then

'file not found

else

'file found

endif
 

um, right before
Errorhandler:

place:
Exit Sub


Winsock1.Listen

Exit Sub

Errorhandler:
StatusBar1.SimpleText = "Log file not found, automatically created"
End Sub
[/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top