TheOriginalBIT, on 28 December 2012 - 03:59 AM, said:
MysticT, on 28 December 2012 - 03:57 AM, said:
brackets are important, otherwise it will just return the function (the actual function, not it's result).
It actually returns the reference/location in memory to the function, not the function itself.
That's what I meant, just trying to make it clearer for him
Quartiz, on 28 December 2012 - 04:16 AM, said:
TheOriginalBIT, on 28 December 2012 - 03:55 AM, said:
sounds like you are doing this in the Lua program on the terminals... type test.test2() instead
the reason that it says function: random numbers is not actually an error, it is doing a tostring( ) on the function and actually telling you its reference/location in memory, hence the numbers differing each time

when this is used in programming intentionally it is called function pointers.
hope this helps

the thing with the () worked like a charm but i still dont understand why the programs isnt working when i program them directly to the turtle or on a floppy disk, any clue?
Like I said before, you need to call the function in the program. It should be something like:
function test2()
-- do something
end
test2() -- call the function so it actually does something