On Apr 14, 2006, at 4:10 PM, Mark O'Neill wrote:

Hi All,

I've noticed that many snippets of code I've seen use something like:

for i = UBound(MyArray) DownTo 0
...
next

instead of

for i = 0 to UBound(MyArray)
...
next

Now, aside from the obvious that DownTo is in reverse order are there any gains in using DownTo?


The UBound is only calculated once with the DownTo.




Seth Willits
----------------------------------------------------------
Freak Software - http://www.freaksw.com/
ResExcellence - http://www.resexcellence.com/realbasic/
----------------------------------------------------------

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to