Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filespec in dirlistbox problems

Status
Not open for further replies.

CUDaveS

Technical User
Jun 12, 2007
17
US
I have this script at several different customers and have never run into this problem until today. And boy, is it frustrating!

I'm displaying a directory listing to allow the selection of multiple files to be uploaded. I have a filespec string of "md*.*" to restrict the display. The problem is that, for this customer, only "MD" files dated with the current date are shown. Opening a Windows Explorer window to the path, I see TONS of files starting with "MD", one for each day. However, displaying my Procomm dialog box only shows 1 "MD" file - the one dated for today!

I don't have any other restrictions in my script nor with the system security. Windows permissions on the folder and files are not restricting based on date. Anyone ever run across anything similar?

For reference, here's a snippet of my code:
Code:
string sClaimsDir = "c:\folder\"
string sFileToSearch = "md*.*"
string sFile = "claims.txt"		

sFileFilter = ""
strcat sFilter sClaimsDir 
strcat sFilter sFileToSearch
dialogbox 0 8 21 264 139 130 "  Choose a Claims File"
   dirpath 1 7 113 198 19 sClaimsDir
   dirlistbox 2 2 2 258 99 sFilter MULTIPLE sFile 1 hscroll sort
   pushbutton 3 219 104 42 14 "&Open" ok default
   pushbutton 4 218 120 44 13 "&Cancel" cancel
enddialog
 
Is it possible that those files not from today have a DOS attribute set that is keeping them from appearing in the dialog? I've copied the text below from the dirlistbox discussion in the ASPECT help file:

The dirlistbox command accepts an optional filetype string which can be used to limit the search pattern to files with specific attributes. The string may be composed of characters representing attribute types: ’R’ for read-only, ’H’ for hidden, ’S’ for system, ’A’ for archive, ’D’ for directory, and ’I’ for drive.

By default, the search always includes normal files, which are files without attributes or files with read-only and/or archive attributes. Directory names and drives are also normally included. For example, if you specify "HS" for search attributes, all files with no attributes, read-only or archive attributes will also appear in the resulting list, in addition to those files having hidden or system attributes.

The character ’X’ may be included to override the default searching method. This indicates that the search is limited exclusively to those files matching one or more of the specified attributes. A list of directory names can be created by specifying "DX" as the search string; only drives will be displayed if "IX" is used.

 
That's probably it. I haven't had a chance to get back on the client's machine to verify but I'm satisfied with this answer - thanks!
 
Okay, follow up question. Several users have complained about the way the files are listed in the DirListBox - that is, they can't see anything other than the file name. Is there a way to display files with their dates, type, etc? I'd prefer to use the Windows OpenFile dialog, but have no clue how I'd do that.

Anyone have any ideas / examples / clues?
 

[highlight] ** Moved this request to a new thread ** [/highlight]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top