 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
BillR69
Joined: 11 May 2007 Posts: 29 Country: United States |
|
FileFindFirst Does Not Work with *.* |
|
The code below works fine. file_name receives the name of the first file found that has an extension of .txt
Dim filepath string "C:\\testme\\*.txt"
Dim file_name string
Dim found boolean
Dim msg string
messagebox filepath
FileFindFirst filepath file_name found
Concatex found " " file_name msg
messagebox msg
However, change the first line to
Dim filepath string "C:\\testme\\*.*"
and found still returns True, but file_name is empty.
Is this a known bug? Or is there some other way to get FileFindFirst to work with total wildcard searches? I have 3.4.26 installed.
|
|
Fri May 11, 2007 12:00 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
|
|
Try dir *.* in DOS and you always get something even if the folder is empty. You actually get "." and ".."
Same thing is here. To remedy this, check if the returned value is empty. If yes, set found to FALSE
Hope this helps
|
|
Fri May 11, 2007 2:21 pm |
|
 |
BillR69
Joined: 11 May 2007 Posts: 29 Country: United States |
|
|
|
Thanks. Just wondered if it was working correctly. I can check the results. That works fine.
|
|
Fri May 11, 2007 2:57 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|