Calling a function inside the function that I'm calling?

Is that even possible? I just want to know. And thank you to Corona Forums Community for answering all of my questions so quickly.

That’s called recursion and definitely works.

[lua]

local function addOne(number)
   print(number)
   number = number + 1
   addOne(number)
end

addOne(0)

[/lua]

This function will continue calling itself and count up until your computer breaks down

So… it’s basically an infinite loop.

You have to set a condition to eventually stop the recursion.

That’s called recursion and definitely works.

[lua]

local function addOne(number)
   print(number)
   number = number + 1
   addOne(number)
end

addOne(0)

[/lua]

This function will continue calling itself and count up until your computer breaks down

So… it’s basically an infinite loop.

You have to set a condition to eventually stop the recursion.