Posted 30 March 2017 - 09:15 PM
Hey guys, I'm really confused….
I have a program like this (this is only part) loaded as an API:
In the lua prompt, if I load the API, set "silent" or "showWarn" to their opposite values, and then run those functions, the functions print the variables as being their original value…. Like… What?
Even more strange, if I print the value from the prompt using:
I have a program like this (this is only part) loaded as an API:
showWarn = true
silent = false
local function except()
print(silent) --for debugging purposes
if silent == false then
--print error details
end
return(true)
end
local function warn(mode)
print(showWarn) --for debugging purposes
if silent == false and showWarn == true then
--print warning
end
return(true)
end
In the lua prompt, if I load the API, set "silent" or "showWarn" to their opposite values, and then run those functions, the functions print the variables as being their original value…. Like… What?
Even more strange, if I print the value from the prompt using:
print(testapi.showWarn)
It shows as the value I set it to…. Then run the function… Suddenly its the original value again… How does that figure? I've checked numorous times and even used find in notepad++ to check, and the only times those variables are read or set is mentioned above…. So I really don't understand what's happening…. Help? Thanks in advance