Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1480

Reset array to 0-Zero - Fast way ?

$
0
0
hi, I have a question:

Supposing to have an array (of doubles), ARR, that contains N values.

To set all values of the array to Zero, is it faster to scan it and set each value
Code:

For i = 0 To N
    ARR(i) = 0
Next

or to use Redim
Code:

Redim ARR(N)
?

Edit: Ooops, sorry for posting this in CodeBank instead of Visual Basic 6 and Earlier

Viewing all articles
Browse latest Browse all 1480

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>