Advertisement
2002C Files/ File Controls/ Input/ Output #12380

A Beginner method to check whether a file exists

A Beginner method to check whether the file exists or not. Simple and should able to run on different Window OS.

AI

AI சுருக்கம்: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

மூலக் குறியீடு
original-source
Public Function CheckFile(InFileName As String) As Boolean <br>
  On Error GoTo ErrHandler <br>
  CheckFile = False <br>
  If Dir(InFileName) <> "" Then <br>
    If (GetAttr(InFileName) And vbDirectory) = 0 Then <br>
      CheckFile = True <br>
    Else <br>
      MsgBox "File doesn't exist!", vbCritical <br>
      Exit Sub <br>
    End If <br>
  Else <br>
    MsgBox "File doesn't exist!", vbCritical <br>
    Exit Sub <br>
  End If <br>
ErrHandler: <br>
  
End Function
அசல் கருத்துகள் (3)
வேபேக் மெஷினிலிருந்து (Wayback Machine) மீட்டெடுக்கப்பட்டது