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

Question about these parameters? [closed]

Asked by
bloxxyz 274 Moderation Voter
10 years ago

Someone showed me their script, and I was looking at the following:

function DataHandler(p,o,key)

This was the very first line in the script. I'm not exactly the best scripter so I don't entirely understand this. What is the key for? Does it have something to do with Tables? This may seem to have a blantly obvious answer, but I could use some help from the community. Thanks.

Locked by SanityMan, Perci1, and BlueTaslem

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
SanityMan 239 Moderation Voter
10 years ago

By the question asked, you probably know what parameters do. The key parameter is somethingnthe writer put in to access something when the function is called. I haven't seen the function, so I can't say exactly, but it could be for a table as you suggested.

If you didn't know what parameters do:

This is the first line of their function that they are defining. The parameters are inserted when calling then function. They can be named whatever the writer wants to call them, usually something short.

Example of use: If I wanted to make a function that adds any given two numbers I could do this:

function add(num1, num2) --defining my function
return num1+num2
end

add(1,1) --returns 2

It takes the parameters and uses them in the function.

Hope this helped!

Ad