Posted 21 August 2015 - 01:49 AM
I am kinda derping and… well… kinda having a program derp.
I made 2 quick programs ot test variable access, I orignally intended to keep this off the forums.
File: variable
File: variableTest
returns ""
returns "6" (as expected)
And if you wanna not debug this code just answer this question: Would it return 5 or 7 optimally?
I made 2 quick programs ot test variable access, I orignally intended to keep this off the forums.
File: variable
local id = idGet
function printID()
print(type(id).." "..type(idGet))
print(id)
end
File: variableTest
idGet = 5
os.loadAPI("variable")
idGet = 7
id = 6
variable.printID()
print(id)
returns "nil nil"returns ""
returns "6" (as expected)
And if you wanna not debug this code just answer this question: Would it return 5 or 7 optimally?
Edited on 20 August 2015 - 11:50 PM