I have a program which reads info from text files using the input command. The problem is that if there is no info in the file the program crashes. How can i stop this?
Printable View
I have a program which reads info from text files using the input command. The problem is that if there is no info in the file the program crashes. How can i stop this?
Use error handler.
Vlad
Thats all very well but dont error handlers let the prog crash any way, simply allowing u to give a differnt message as it does so. Besides, precisely how do i do this??
Use:
'This forces the code to continue regardless of an error
on error resume next
then use err.number to determine the type of error.
'This turns off error handling
on error goto 0
If you can search your help for the following
on error goto
on error resume next
err
I hope this helps
Hi
Check FileLen(Filename). If its zero then don't read the file.
Hope that helps.
Nandini