Hi Dan

I tried that, and it doesn't work (even after substituting request.write
with response.write (I assume this was a typo))

There should only be 5-10 files there, but maybe a quicksort would be
better. Except, I don't know what a quicksort is.

I'll google it and check learnasp.com but if I haven't responded by the end
of the day, some extra help would be great.

cheers
Nick

   From: "Dan Powderhill" <[EMAIL PROTECTED]>
Subject: RE: Alternatives for a FOR, NEXT loop

If you're stepping using -1 you should have lBound first, like so :-
 
For MySort = LBound(MyArray) to UBound(MyArray) step -1
Next 'sorting
request.write MyArray(MySort)
Next 'files

How many files are you talking about here? A quicksort might be more
efficient, unless that's what you're doing in your for loop.
 
Dan

_______________________________

From: Driver, Nicholas [mailto:[EMAIL PROTECTED] 
Subject: Alternatives for a FOR, NEXT loop


Hi Guys

Here's the problem.

I've listed files in a directory on my server (using FSO) and am trying to
sort the resulting list by loading the values into a array and then sorting
the array.

I've used 

For Each File...
For MySort = LBound(MyArray) to UBound(MyArray)
Next 'sorting
request.write MyArray(MySort)
Next 'files

However, I can't get it to sort in descending order (the files names
have a prefix plus the date on which they were created) I've tried For
MySort = UBound(MyArray) to LBound(MyArray) Step -1

But that gives me an error (which I can't seem to replicate, sorry).
Also, the "step" isn't recolouring (in Dreamweaver) which suggests to me
that it's not being identifed as a reserved word.

So, my question is "What can I use instead of a For Next loop to sort an
array into descending order since the step method of the FOR NEXT isn't
working?"

If anybody has any ideas, I'd be extremely greatful.

peace
Nick

--------------------------------------------------------------------------------
This E-Mail is intended only for the addressee. Its use is limited to that
intended by the author at the time and it is not to be distributed without the
author's consent. Unless otherwise stated, the State of Queensland accepts no
liability for the contents of this E-Mail except where subsequently confirmed in
writing. The opinions expressed in this E-Mail are those of the author and do
not necessarily represent the views of the State of Queensland. This E-Mail is
confidential and may be subject to a claim of legal privilege.

If you have received this E-Mail in error, please notify the author
and delete this message immediately.
--------------------------------------------------------------------------------
!DEPTSTAMP1!


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to