forwarding a lua code to another -
i have lua code called lua file , wants assign value , print out value getting "nil", please me. here code:
function main_setup() package.path = package.path ..";c:/users/kude/desktop/mqtt1/?.lua" require "ds18b20" end local = main_setup() print(a)
output:
nil
function main_setup() package.path = package.path ..";c:/users/kude/desktop/mqtt1/?.lua" require "ds18b20" end
this function not return anything.
so
local = main_setup()
is equivalent to
local = nil
hence
nil
is expected output of
print(a)
Comments
Post a Comment