I wish I knew how to make my code appear as code. Anyways…
This procedure takes 9 seconds to run. None of my other code is sluggish at all, just this one. The loop is executed 27 times. Is this normal?
starttime = now()
pointer = 11 // point to second week
loop loopindex counter
// total points = points this week + prev total points - penalty this week
TeamStats = arraychange(TeamStats,(array(TeamStats,pointer+1) +
array(TeamStats,pointer-6) - array(TeamStats,pointer+2)),pointer+4)
// total penalties = penalty this week plus prev total penalties
TeamStats = arraychange(TeamStats,array(TeamStats,pointer+2) +
array(TeamStats,pointer-5),pointer+5)
// total weeks = week played this week + previous total weeks
TeamStats = arraychange(TeamStats,
(array(TeamStats,pointer+6) + array(TeamStats,pointer-3)),pointer+7)
// points per match = total points divided by total weeks (if ≠ 0)
if array(TeamStats,pointer+7) ≠ 0 // weeksplayed ≠ 0 ?
TeamStats = arraychange(TeamStats,(array(TeamStats,
pointer+4) / array(TeamStats,pointer+7)),pointer+8)
endif
pointer = pointer + 10 // point to the next week
until counter = (NumberofWeeks - 1)
stoptime = now() message (stoptime - starttime)