我在从 C++ 调用的库中使用 Lua (5.2.1)。
例如,在 C++ 中,我调用函数 OnHear 并传递听到的文本。
然而,在我的 Lua 文件中,我检查了一些奇怪的东西:
function OnHear(_Text)
txt = _Text;
txt = string.lower(txt); -- comment this line to make the code below run
-- other code
end
这没用; 当注释低的行时,“其他代码”运行良好,但如果正在执行,则不会。
function OnHear(_Text)
txt = string.lower(_Text);
-- other code
end
同样的问题...
我还发现,当我调用例如 string.len(txt) 或类似的东西时,会发生同样的问题(之后的代码没有被执行)......
我不知道什么可能导致我的问题,谷歌搜索/搜索 Stackkoverflow 并没有帮助我,遗憾的是......
感谢您提前回复!