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

Help with conventions?

Asked by 8 years ago

Alright so im making a few very broad functions for my game to use and i am giving them quite a lot of parameters 5 - 6 each so first is this an ok convention and second off if i dont want to pass a parameter is it ok to call a function like this

myFunction(parameterA,    , parameterC)

doing this as so the second parameter is not passed

1 answer

Log in to vote
0
Answered by 8 years ago

Depending on the function, you may want to consider using a single table parameter instead of a ton of parameters that may or may not be passed.

As for your function call, you'll have to explicitly put nil in place of blank arguments when they are not at the end of the arguments.

0
ok so the call would look like myFunction(parameterA, nil, parameterC) ProfessorSev 220 — 8y
0
Yes. User#6546 35 — 8y
Ad

Answer this question