◄Example► ◄Contents► ◄Index► ◄Back► ────────────────────────────────────────────────────────────────────────────── ' This example prints the values of ERDEV and ERDEV$ after the program ' generates an error attempting to open a text file. ' To try this example: ' 1. Choose New Project from the File menu ' 2. Copy the code example below to the code window ' 3. Press F5 to run the example DEFINT A-Z ON ERROR GOTO ErrorHandler ' Indicate first line of error handler OPEN "A:JUNK.DAT" FOR INPUT AS #1' Attempt to open the file END ErrorHandler: ' Error handling routine PRINT "ERDEV value is "; ERDEV ' Prints values of ERDEV and ERDEV$ PRINT "Device name is "; ERDEV$ ' and returns error control to Visual Basic SLEEP 2 ON ERROR GOTO 0