Checking the existence of a file
By: Lorenzo Dalla Vecchia Date: 02/05/1998
File:

fileexists.zip

Size:

1.18 KB

Download now!

An easy way to check the existence of a file is by trying to open it. If the file does not exist, an error will occour. We handle the error with an error trapping routine; if the routine is called, it means the error occoured and that the file does not exist, otherwise the file exists.

This function checks the existence of a file by trying to open it. If the operation fails, it means that the file does not exist.

Syntax

FileExists (filename$)

Parameters

filename: name and/or path of the file to check the existence of

Type of data

Boolean

Returns

True if the file exists
False if the file does not exist

-

The function is contained in a module. You can cut and paste it in any program of yours.

Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
Webmaster's e-mail: webmaster@vbprogzone.cjb.net
Hosted by InWind: www.inwind.it