ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
ERDEV and ERDEV$ Functions Example
                        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