avatar
January 8th, 2000, 06:20 AM
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?
|
Click to See Complete Forum and Search --> : input error avatar January 8th, 2000, 06:20 AM 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? January 8th, 2000, 07:15 AM Use error handler. Vlad avatar January 8th, 2000, 01:39 PM 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?? wilton January 8th, 2000, 03:00 PM 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 nandini January 10th, 2000, 03:03 PM Hi Check FileLen(Filename). If its zero then don't read the file. Hope that helps. Nandini codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |