I use this function to open files and return the error code if needed.
Other processes have acces to the file so the function allows for this and wait for a max of 20 seconds (more than enough time for other processes to finish)
I added the statement #DEBUG DISPLAY ON
I had an error display message today showing un untrapped error 70 in this function.
Can't see why the code should produce this, an I using ON ERROR RESUME NEXT correctly?
Other processes have acces to the file so the function allows for this and wait for a max of 20 seconds (more than enough time for other processes to finish)
I added the statement #DEBUG DISPLAY ON
I had an error display message today showing un untrapped error 70 in this function.
Can't see why the code should produce this, an I using ON ERROR RESUME NEXT correctly?
Code:
FUNCTION Open_Seq_In( BYVAL Han AS LONG, BYVAL SharedMode AS LONG, FileSpec AS STRING ) AS LONG ' ' SharedMode = 1 if open in shared read LOCAL ErrCount AS LONG ' ErrCount = 0 DO ERRCLEAR ON ERROR RESUME NEXT IF SharedMode = 0 THEN OPEN FileSpec FOR INPUT ACCESS READ LOCK READ WRITE AS Han ELSE OPEN FileSpec FOR INPUT ACCESS READ LOCK SHARED AS Han END IF IF ERR = 0 OR ErrCount = 80 OR ERR <> 70 THEN EXIT DO END IF INCR ErrCount SLEEP 250 LOOP ' FUNCTION = ERR ' END FUNCTION
Comment