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

Is it possible to have a function inside a dictionary?

Asked by 5 years ago

Wondering if you can have functions like;

function Start()
    --do stuff here
end

in side of dictionaries. So when you access that definition, it calls the function. If this is possible, what all is possible by doing this?

0
Yes, that's how the math, string, table, etc libraries work. hiimgoodpack 2009 — 5y
0
How would I place a function inside of one then? I am unsure of how to properly do it. Stephenthefox 94 — 5y
0
`Table[Key] = Func` would be one example. TheeDeathCaster 2368 — 5y
0
I tried that, Stephenthefox 94 — 5y
View all comments (3 more)
0
I guess my real question is, how would I call the function then? Stephenthefox 94 — 5y
0
simply say Start() nothing more nothing less.... function thing() end thing() greatneil80 2647 — 5y
0
Right but I would want to call only the function of the table[Key], lets say I have 2 keys with 2 different functions. I want to call the 1st one. Stephenthefox 94 — 5y

Answer this question