Hi,
Thank you so much for your help. Could you just tell me what the "for" is when you call the subroutine in the main program? I have seen "for" only in the context of a for loop where you also supply the 3 parameters like initial index, final, and increment.
By the way, everything else you explained to me I completely understood and my script now works perfectly. Thank you so much!!