|
-
April 14th, 2001, 04:03 PM
#1
existing files
Is there a way to tell if a certain file exists? Like a function or something? Perhaps:
FileExist("c:\Windows\whatever.txt")
Any help is appreciated.
-
April 15th, 2001, 02:08 AM
#2
Re: existing files
refer
http://vblib.virtualave.net
there is a function IsFileExist in vbFileIO class,
hope this help.
-
April 15th, 2001, 08:26 AM
#3
Re: existing files
If you know the path of the file, you can use the Dir$ function to check whether the file exists.
-
April 15th, 2001, 11:06 AM
#4
Re: existing files
And the code looks a bit like this:
function IsFileExist(szFileName as string) as boolean
' default to not exist
IsFileExist = false
if (dir(szFileName, vbNormal) <> "") then
' found it
IsFileExist = true
end if
end function
-Cool Bizs
Good Luck,
-Cool Bizs
-
April 15th, 2001, 11:12 AM
#5
Re: existing files
Yes, and a one line solution as follows:
function IsFileExist(szFileName as string) as boolean
IsFileExist = (dir(szFileName, vbNormal) <> "")
End Function
-
April 15th, 2001, 11:50 AM
#6
Re: existing files
Thanks a lot. It really helped.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|