Posts: 1,813
Threads: 284
Joined: Mar 2003
Quote:Having it inside the loop slows it down a little. What he's saying is it's better to have to outside the loop...
...because you're just doing the same equation 6 times, when it only needs to be done once. If it was
Code:
FOR i = 1 TO 6
num(i) = i
PRINT num(i)
NEXT
then that would be fine, because you're changing 6 different variables to 6 different values. Even if it was just
or
I'd still say it's okay to do, because at least one value in the equation is the variable that's changing 6 times. But
is just plain bad to put *inside* a loop, because it only needs to be done once (because nothing in the equation is changing).
earn.
Posts: 394
Threads: 16
Joined: Jun 2003
pretend you're the teacher and QB is the student. the student'd be pissed if you made him do the same damn thing six times.
ammit potato!
Posts: 3,343
Threads: 83
Joined: Mar 2003
Quote:pretend you're the teacher and QB is the student. the student'd be pissed if you made him do the same damn thing six times.
:lol: Very good analogy