Thanks this is helpful. I was hoping this would speed up my code, but feels like the for loop has similar speeds which surprises me. Any suggestions?
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
t1 = tick seconds();
numberarray = Function({list},
temparray = Associative Array(list);
tempnum = nitems(temparray << Get Keys);
tempitems = temparray << Get Keys;
templist = {};
For(l=1, l<=tempnum, l++, insertinto(templist, l));
temparray = Associative Array(tempitems, templist);
//return(temparray)
);
for(i=1, i<=100,i++,
array = numberarray( Column(dt, 1) );
array2 = numberarray( Column(dt, 2) );
array3 = numberarray( Column(dt, 3) );
array4 = numberarray( Column(dt, 4) );
array5 = numberarray( Column(dt, 5) ););
t2 = tick seconds();
Print( Concat( Char( t2 - t1 ), " seconds." ) );
t1 = tick seconds();
numberarray = Function({list},
temparray = Associative Array(list);
tempnum = nitems(temparray << Get Keys);
tempitems = temparray << Get Keys;
temparray = Associative Array(tempitems, 1::tempnum);
);
for(i=1, i<=100,i++,
array = numberarray( Column(dt, 1) );
array2 = numberarray( Column(dt, 2) );
array3 = numberarray( Column(dt, 3) );
array4 = numberarray( Column(dt, 4) );
array5 = numberarray( Column(dt, 5) ););
t2 = tick seconds();
Print( Concat( Char( t2 - t1 ), " seconds." ) );