Search found 2 matches
- Thu Oct 08, 2015 5:25 pm
- Forum: Support and Development
- Topic: Functions with a variable number of arguments
- Replies: 3
- Views: 3485
Re: Functions with a variable number of arguments
Oh, okay, thanks! For some reason the "arg" variable still works for me in regular Lua, though, even though I believe the Lua for windows version I have is 5.1.4.
- Thu Oct 08, 2015 2:03 am
- Forum: Support and Development
- Topic: Functions with a variable number of arguments
- Replies: 3
- Views: 3485
Functions with a variable number of arguments
So in Lua, if I want to make a function accept a variable number of arguments, the way I learned to do this was by using ... in the function heading and using the variable "arg" to reference all the arguments in a table. For instance, a completely redundant print function: function print2(...