Posted 17 February 2014 - 08:00 AM
Hello.
I have no idea if this've been asked before, but i am having trouble executing a function from a function inside the same table…
what is happening:
my table code
Note that im having different functions all around my full code etc.. ( like a button function )
Do i really have to seperate these functions into stand-alone functions instead of having them in one table?
Thanks in Advance
Edit…. 555'th post xD
I have no idea if this've been asked before, but i am having trouble executing a function from a function inside the same table…
what is happening:
Spoiler
menu = {
function_one=(
function()
end
)
function_two=(
function()
menu.function_one() -- this is returning attempt to call nil..... why?
function_one() -- i also tried with this, but the same error....
end
)
}
my table code
Note that im having different functions all around my full code etc.. ( like a button function )
Spoiler
local menu={
settings=(
function()
end
);
start=(
function()
activeWindow={
xmin=1,xmax=screen[1]/2-screen[1]/2/2/2,ymin=6,ymax=18
}
for i = 18,6,-1 do
paintutils.drawLine(
1,
i,
screen[1]/2-screen[1]/2/2/2,
i,
colors.gray,
colors.white
)
end
setButton(
"Settings",
settings, -- this is the function which should be executed
1,
screen[1]/2-screen[1]/2/2/2,
6,
8,
colors.black,
colors.yellow,
colors.red,
false
)
Buttonscreen()
end
);
}
Do i really have to seperate these functions into stand-alone functions instead of having them in one table?
Thanks in Advance
Edit…. 555'th post xD
Edited on 17 February 2014 - 07:15 AM