If I have a for loop with a function in it
For i = 0 to ubound(myarray)
'code
next
does vb have to call the function every time it loops, or does it store the value of the call in memory?
Thanks.
Printable View
If I have a for loop with a function in it
For i = 0 to ubound(myarray)
'code
next
does vb have to call the function every time it loops, or does it store the value of the call in memory?
Thanks.
will call it everytime. same with any other loop.
It calls it everytime which gives u the ability to send a diff value to the function everytime (As shown below) - If the value of your function isnt going to change call it before your loop
For i = 0 to ubound(myarray)
Call FunctionName(i)
next
Thats what I thought, but the debugger never goes to that line once it enters the loop, so that made me begin to question it.
Thanks!!!
If you want to save some time
code with a stored variable
Code:Dim ub As Integer
ub = UBound(myarray)
For I = 0 To ub
Call FunctionName(I)
Next
'Code improved by vBulletin Tool (Save as...)