|
-
Oct 5th, 2000, 05:41 PM
#1
Thread Starter
Lively Member
I have a textbox where the user can browse for a file or type the filename in the textbox. If the user types the filename, how do I check to see if that file exists or not?
-
Oct 5th, 2000, 05:44 PM
#2
Code:
If Dir$("MyFileName") <> "" Then
'File exists
Else
'File does not exist.
End If
-
Oct 5th, 2000, 06:32 PM
#3
For user input:
Code:
Private Sub Command1_Click()
Dim file As String
file = InputBox("What file do you want to check?")
If file <> "" Then
If Dir$(file) <> "" Then
'File exists
Else
'File does not exist.
End If
End If
End Sub
-
Oct 6th, 2000, 11:46 AM
#4
Thread Starter
Lively Member
Directory exists?
How do you check if a directory exists? Thanks.
-
Oct 6th, 2000, 11:55 AM
#5
transcendental analytic
If Dir$(Mydirectory,vbDirectory) <> "" Then 'that directory exists
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|