| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== ERRORFILE (return error filename) ====== | [[errorcode return error code number .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[event return event number .htm|{{btn_next_n.gif|Next page}}]] | | || **ERRORFILE( )** {{blk2blue.jpg|blk2blue.jpg}} The **ERRORFILE** procedure returns the name of the file for which an error was posted. If the file is open, the full DOS file specification is returned. If the file is not open, the contents of the FILE statement's NAME attribute is returned. If the file is not open and the file has no NAME attribute, the label of the FILE statement is returned. If no error was posted, or the posted error did not involve a file, ERRORFILE returns an empty string. | **Return Data Type:** | STRING | **Example:** **ADD(Location)                          !Add new entry** **IF ERRORCODE()** ** MESSAGE('Error with ' & ERRORFILE())  !Display error filename** **END** **See Also:** [[errorcode return error code number .htm|ERRORCODE]] [[error return error message .htm|ERROR]] [[fileerrorcode return file driver error code number .htm|FILEERRORCODE]] [[fileerror return file driver error message .htm|FILEERROR]] [[poperrors return error information .htm|POPERRORS]] [[pusherrors write error information .htm|PUSHERRORS]] [[trappable run time errors.htm|Trappable Run Time Errors]]