Re: Dir command in VB
From: Scott M. (scottm_at_symagery.com)
Date: 09/09/04
- Next message: Ralph: "Re: How I can do a commit without loose my cursor with an rdo conn"
- Previous message: Bob Butler: "Re: VB6 vs VB.NET"
- In reply to: Ken Halter: "Re: Dir command in VB"
- Next in thread: MikeD: "Re: Dir command in VB"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Sep 2004 09:37:29 -0400
Thanks for the information. I will try the listbox trick. There are many
little improvements I'd like to see in VB and I wish they'd release a VB7
instead of forcing everyone to vb.net, which I have no plans to ever use.
I didn't even notice that I had used "+" signs in my code until you brought
it up. I suppose I should have written it as;
sFilename = Dir(App.Path & "\Images\*.bmp")
Scott
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:OBsqEBflEHA.3824@TK2MSFTNGP12.phx.gbl...
> Scott M. wrote:
> > I want to be able to sort my Dir listings from within VB6. I presently
use a
> > command like
> >
> > sFilename = Dir(App.Path + "\Images\" + "*.bmp")
> >
> > to build a list of bmp files but VB generates the list in random order.
Is
> > there any way to sort by name or date as I could in DOS?
> >
> > Scott
>
> No support for sorted returns from Dir.
>
> Probably the easiest way to sort that list is.... set up an invisible
> ListBox that has its Sorted property = True. Load that ListBox with the
> returns from Dir and, when ready to parse, get the info from the ListBox.
>
> btw... you should be using "&" to concatenate strings... not "+" so..
>
> > sFilename = Dir(App.Path & "\Images\" & "*.bmp")
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep all discussions in the groups..
- Next message: Ralph: "Re: How I can do a commit without loose my cursor with an rdo conn"
- Previous message: Bob Butler: "Re: VB6 vs VB.NET"
- In reply to: Ken Halter: "Re: Dir command in VB"
- Next in thread: MikeD: "Re: Dir command in VB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|