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

?func coding Drives You Nutz!

Asked by 5 years ago
Edited 5 years ago

I want to make a problem clear, that probably has a devforum thread. However, it doesn't change the fact I can't find any solution:

-- if i have a function
function test()
-- can I call it from inside
test()
end

--[[ my functions are
going to be more but
what are the ways one can be used... --]]
0
you need something to trigger the function Gameplayer365247v2 1055 — 5y
0
Agreed!!!! Sapppower 17 — 5y

1 answer

Log in to vote
0
Answered by
BenSBk 781 Moderation Voter
5 years ago

Yes, you can call a function from within the same function as long as the function holds a reference to itself (through a global or local variable).

You use/call a function by referring to the function along with an argument list (), so:

``` local function f(...) -- ... end

f() -- call function f f("a", 123, {}) -- pass arguments to function f ```

0
is "self" keyword also a table like "..." Sapppower 17 — 5y
0
self is a local that is implicitly assigned to the first argument passed to a function when you define the function with the colon syntax BenSBk 781 — 5y
0
thank you Sapppower 17 — 5y
Ad

Answer this question