|
-
Nov 8th, 1999, 03:41 AM
#1
Thread Starter
Fanatic Member
Is there a way to check if some string is a valid file name without bunch of if's or select case statements?
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
-
Nov 8th, 1999, 03:53 AM
#2
Hyperactive Member
If you are trying to find out if the file exists, then use this:
Module Code:
Code:
Public Function FileExist(ByVal FileName As String) As Boolean
If Dir(FileName, vbNormal) <> "" Then
FileExists = True
Else
FileExists = False
End If
End Function
That is untested, but should work.
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
-
Nov 8th, 1999, 04:02 AM
#3
Thread Starter
Fanatic Member
Thanks for your reply but I'm not trying to find out if file exists. I'm trying to find out if user typed a valid file name (ex. qwerty.txt - valid, *.txt - invalid)
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
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
|