VBCE.com - The Premier Website For Visual Basic/CE Developers

 

*Dev Corner

Sample Code
Controls
Workarounds
Tips & Tricks
Q & A
Forums

*Goodies
Downloads
Software
Bookstore


*General
Home
What's New
General Info
Misc. Info


*News Worthy
News
Articles
Editorials
KB Articles
Reviews
Awards

*Miscellaneous
Web Links
Partners
Search
Feedback
Advertising

<% On Error Resume Next SiteStats() %>

Sponsors


More...


Code Sample: FileOrDirExists Function

Public Function FileOrDirExists(FileSys, FileName)
    '=============================================
    'PURPOSE: Checks for the existence of a file
    '         or directory
    'PARAMS:  FileSys A FileSystem Control
    '         FileName A FileName to look for
    'RETURNS: 0  File Not Found
    '         -1 File Exists
    '         >0 Error Number

    '=============================================

    Dim ReturnVal
    On Error Resume Next
    ReturnVal = FileSys.Dir(FileName)
    If Err.Number = 0 Then
        If
ReturnVal = "" Then
            FileOrDirExists = False 'File Not Found
        Else
            FileOrDirExists = True 'File Found
        End If
    Else

        FileOrDirExists = Err.Number 'Return Error Number
    End If
End Function


VBCE.com is DevX Winner!

Unless otherwise noted, all information on VBCE.com is Copyright 1998 - 2002
Windows, Windows CE, and Visual Basic are trademarks of the Microsoft Corporation.
VBCE.com is not responsible for content on external sites.
Send all feedback to webmaster@vbce.com
Webmasters - feel free to link to
VBCE.com - Premier Website for Visual Basic/CE Development

Buy Books!