Originally Posted by Aanson
3. I'd like to call a function with several arguments. But say I'd rather not pass the first arg... how do I skip the first argument and move on to the second?
Is it something like...
Lua Code:
MyFunction(_, arg2, arg3)
... Then again, I've tried that and it's returned an error in the past.
|
In addition to the answer above, there is a lot of misconception going around about "_" being a special character to Lua that skips values. Truth is, Lua just sees it as another variable like "x" or "Y". Its use is more common for disregarding unneeded return values from a function or vararg expression that is faster than using
select(). Lua does assign values to the variable "_", but further code usually does nothing with those values.