最新版本的Loadstring函数替换 [英] Loadstring function replacement in latest version

查看:79
本文介绍了最新版本的Loadstring函数替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从lua 5.1更新到5.3.2,我的一个脚本不起作用是attempt to call a nil value (global 'loadstring')的原因,所以,他们是否将其替换为新功能?

I updated from lua 5.1 to 5.3.2 , One of my scripts didn't work cause of attempt to call a nil value (global 'loadstring') So, did they replace it with a new function?

您可以在其中找到函数 https://www.lua.org/pil/8. html
您可以在此处进行测试(无法使用) http://www.lua.org/cgi- bin/demo

There you can find the function https://www.lua.org/pil/8.html
There you can test it ( won't work) http://www.lua.org/cgi-bin/demo

推荐答案

自Lua 5.2起,loadstring已由

Since Lua 5.2, loadstring has been replaced by load.

摘自 Lua 5.2参考手册:

不推荐使用功能loadstring.使用load代替;现在它接受字符串参数,并且完全等同于loadstring.

Function loadstring is deprecated. Use load instead; it now accepts string arguments and are exactly equivalent to loadstring.

这篇关于最新版本的Loadstring函数替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆