VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A FileExists Function

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

Rate A FileExists Function

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

Download this snippet    Add to My Saved Code

A FileExists Function Comments

No comments have been posted about A FileExists Function. Why not be the first to post a comment about A FileExists Function.

Post your comment

Subject:
Message:
0/1000 characters