Re: Dir command in VB
From: Ken Halter (Ken_Halter_at_Use_Sparingly_Hotmail.com)
Date: 09/08/04
- Next message: François de Dardel: "Re: Boolean variables get translated into German..."
- Previous message: Saga: "Re: Include Excel Work*** in VB exe?"
- In reply to: Scott M.: "Dir command in VB"
- Next in thread: Scott M.: "Re: Dir command in VB"
- Reply: Scott M.: "Re: Dir command in VB"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 08 Sep 2004 15:07:42 -0700
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: François de Dardel: "Re: Boolean variables get translated into German..."
- Previous message: Saga: "Re: Include Excel Work*** in VB exe?"
- In reply to: Scott M.: "Dir command in VB"
- Next in thread: Scott M.: "Re: Dir command in VB"
- Reply: Scott M.: "Re: Dir command in VB"
- Messages sorted by: [ date ] [ thread ]