by Blake Royer (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (19 Votes)
Checks to see if a file exists.
Inputs
full file path(FullFileName as String)
Code Returns
True or False
Private Function FileExists(FullFileName As String) As Boolean
On Error GoTo MakeF
'If file does not exist, there will be an error
Open FullFileName For Input As #1
Close #1
'no error, file exists
FileExists = True
Exit Function
MakeF:
'error, file does not exist
FileExists = False
Exit Function
End Function