Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

List of function parameters? [closed]

Asked by
emite1000 335 Moderation Voter
10 years ago

When you write a function, you have to put in two parenthesis, that can include an extra parameters to do more stuff with your script (I don't really know what the word in there actually does, because everyone's description has confused me).

Could someone write me a complete list of the words that can go in those parenthesis?

Locked by adark and TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
3
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

Parameters are just local variables used in the declaration of a function:

function funcName(param1, param2)
end

Arguments are what you use when calling the function. The values passed as arguments are the values the parameters hold.

funcName(arg1, arg2)

There is a limit on the allowed number of parameters, but it's too high to care about. If you reach it, you need to make smaller functions.

To answer your actual question, there is no set list of allowed 'words' for parameters, just as there is no set list of allowed variable names.

1
FYI, technically, they're upvalues. But it doesn't matter in this case. TheLuaWeaver 301 — 10y
0
Is there a case where the distinction matters? I'm legitimately curious. adark 5487 — 10y
Ad