Your function returns on line 7. However, n isn't incremented until line 9, which will never be exectued (since the function will have returned by this point).
Move the n++; line before the return word; line.
ravenous
Practically a Master Poster
681 posts since Jul 2005
Reputation Points: 286
Solved Threads: 111
Skill Endorsements: 9
Or better, move the return statement to end of the function so that the .close() will be executed as well.
vmanes
Postaholic
2,015 posts since Aug 2007
Reputation Points: 1,283
Solved Threads: 242
Skill Endorsements: 6
Question Answered as of 5 Months Ago by
ravenous
and
vmanes