try the push function to add an element to an array.
In reply to Re^3: accessing variable vaule outside for loop by Anonymous Monk in thread accessing variable vaule outside for loop by gaurav