Sunday, May 13, 2012

Variable Arguments

 function printAll(...)  
      for i=1, #arg do  
           print(i, arg[i])  
      end  
 end  
   
 printAll("Megadeth", "Metallica", "Slayer", "Anthrax")  

No comments:

Post a Comment