[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: "clear" array
- From: "Wesley Smith" <wesley.hoke@...>
- Date: Thu, 28 Sep 2006 17:56:03 -0700
I'm trying to "clear" an array after a loop is run and reuse it again
on the next iteration. By "clear" I mean that I wat #array to be 0.
So, if I have:
array = {}
--add stuff to array in loop
array[#array+1] = stuff
--end loop
--clear array
array[1] = nil
print(#array)
What I'm getting from the print statement is the length of the array
after the loop ended, not the expected 0. Is this correct? I don't
see why this wouldn't work.
thanks,
wes