Re: Dir command in VB

From: Scott M. (scottm_at_symagery.com)
Date: 09/09/04


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..



Relevant Pages

  • Re: Dir command in VB
    ... Scott M. wrote: ... > I want to be able to sort my Dir listings from within VB6. ... ListBox that has its Sorted property = True. ...
    (microsoft.public.vb.general.discussion)
  • Re: OnHScroll/OnVScroll - position is only 16 bits?????? - any way around this?
    ... Brilliant - thanks Scott!!! ... erm, what do people do on 95/98/ME? ... i've got a ListBox with a very large number of potential items ...
    (microsoft.public.vc.mfc)
  • Re: Populating Mulitiselect Listbox
    ... private void lstTrades_DataBinding(object sender, EventArgs e) ... Scott ... The listbox is currently in the aspx, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Assigning ListBox Current Selection to TextBox
    ... >> I'm a novice user having troubles retrieving data from a listbox in VB ... >> I'm trying to assign the current listbox selection to a textbox using: ... >> return just a single field and I couldn't find anything in 'Help'. ... Scott ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Listbox selecteditem - newbie question
    ... Scott & Hall ... IT's a scrollbar as you put it :-) ... > height of your listbox was only tall enough to show 1 item. ...
    (microsoft.public.dotnet.languages.vb)