|
-
Jan 4th, 2001, 09:50 PM
#1
Thread Starter
Hyperactive Member
Hi Team
I'm trying to open a file using wildcards, but it doesn't work.
I want to find a file called "5(0)23_345.bmp". But at run time all I know is the 23 of the above name.
However I know that the 23 will always be preceded by ) and followed by _ ie:
the 5(0) can be any value in that formate ie ?(?);
the _345 will allways be in that format but with any number of digits, ie _*
To find such a file t tried using the mask ????23_*
But this does not work in VB, but does in dos
My actual code is
Picture1.Picture = LoadPicture ("C:\???23_*")
I have also tried cutting this back to bare bones with
Picture1.Picture = LoadPicture ("C:\?(0)23_*")
But this still does not work
However, for all you cynics who think I may be a total idiot
Picture1.Picture = LoadPicture ("C:\5(0)23_345.bmp") does work.
If you have any ideas or want to clarify anything I'm happy to answer questions.
-
Jan 4th, 2001, 09:59 PM
#2
Addicted Member
If it were me...
I'd use the File System Object to retrieve the full filename to a variable, then use Loadpicture with the variable.
Hope this helps!
-
Jan 4th, 2001, 10:02 PM
#3
New Member
The wild card characters (? and *) are used to represent more than one file. So it is not possible to open a single file using wildcards.
why don't you try this:
place a FileListBox and set its Pattern property to your criteria. after that you can retrieve the name of the file from the listbox.
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
|