LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Creating vectors of numbers

"Harlan Grove" wrote:

I said easy, not fast. If you want fast, this is a case in which VBA
looks are faster. However, if fast is the goal, there are faster
approaches than your LoopArray function.

First, only use error checking when necessary. In this case, it's not.
You can (and should) check your arguments before allocating your
return array and looping through it. Error checking slows things down.

Second, use integers (best, Longs) for For loop control variables, and
it's almost always best to loop on the array index, not the values
that would be stored in the array.

So here are functions to return horizontal and vertical arrays.


not unexpected ...
... i just thought you might come back with some 'pure' code.
<VBG

you're correct.. my code wasn't optimed for speed either.
my point was merely to demonstrate the relative slowness of the
the evaluate/row construct

re the errorhandler..
the way I used the errohandler to jump out of illegal input, may not be
gracefull but does NOT slow it down, at least i tried to test this but
could find no difference (even with large arrays or very high number of
calls to the function.

which I'd like to explain like this:
when I dont define an errorhandler the default errorhandler is
implicitly active e.g on error goto 0..

as long as my code doesnt jump back and forth between labels due to
trapped but resumed or handled code there should be no difference.


my bonus.. your 'pure' code


thanks!



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to plot velocity vectors? Dakujr Charts and Charting in Excel 1 May 2nd 06 10:34 AM
Vectors on Charts Wyvern Charts and Charting in Excel 1 November 22nd 05 12:40 AM
adding vectors.. help on how Ralph2 Excel Discussion (Misc queries) 1 November 1st 05 01:50 PM
Multiple Vectors Notation Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 May 3rd 05 06:56 PM
Eigenvalues and vectors goltinfron Excel Programming 1 March 1st 04 03:06 PM


All times are GMT +1. The time now is 03:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"