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] 
Sent: 31 March 2005 06:24
To: [email protected]
Subject: [AspClassicAnyQuestionIsOk] 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 Sponsor   
ADVERTISEMENT
click here
<http://us.ard.yahoo.com/SIG=129r9dmit/M=298184.6018725.7038619.3001176/
D=groups/S=1705006764:HM/EXP=1112333202/A=2593423/R=0/SIG=11el9gslf/*htt
p://www.netflix.com/Default?mqso=60190075>      
 
<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=group
s/S=:HM/A=2593423/rand=462025640>       

________________________________

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]
<mailto:[EMAIL PROTECTED]
subscribe> 
          
*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]



 
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