如何忽略“如果”争论lua
我想绕过/忽略Global中的“ if”参数的回报。
例子。 (xy代表MISC ARG)
全局脚本第1行1
if x == y then
os.exit()
return
end
function HOME()
-- some codes
end
HOME()
-- end script
我将使用PCALL从另一个脚本加载此脚本(..
我想知道,如何忽略所有全局参数,因此,当该脚本直接到HOMER(),如果此脚本()甚至可能。 我知道如果我可以在主脚本中写入
pcall("script above")
HOME()
我可以得到的home(),但是只有上面的脚本完全正确运行(编辑脚本也不是一个选项,我可以做,
os.exit=print
pcall(
但“返回”仍然退出脚本
I want to bypass/ignore the returns from "if" arguments in global.
example. (x y represent misc arg)
global script line 1
if x == y then
os.exit()
return
end
function HOME()
-- some codes
end
HOME()
-- end script
I'll be loading this script from another script by using pcall(..
I want to know, how to ignore all global arguments, so when that script goes straight to HOME() if this is even possible. also, I'll be doing this from android phone, using a program that has limited lua functions, things like popen, execute are disabled
I know if I write in the main script
pcall("script above")
HOME()
I can goto HOME() but only if the script above runs completely through correctly (editing the script is also not an option, I could do
os.exit=print
pcall(
but the "return" still exits the script
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想为功能设置环境。
You want to set the environment for the function.