lua:<表达>预计接近'
我的项目是创建一个可以让用户一次打开多个文件夹的脚本,并且用户可以键入他们想要创建文件夹的路径。 这是导致我问题的代码的一部分。
List_length = #Filename
List_next = 1
function Main(Filename)
for List_next, List_length, List_next in
do os.execute("mkdir " .. Folderpath.. Slash .. Filename)
List_next = List_next + 1
end
SuscessMSG()
end
Main(Filename)
问题:
Lua: <expression> expected near 'do'
我不知道问题是什么,我看过Lua关于表达的文档,但我仍然不明白如何解决此错误。
有人可以帮我吗?谢谢。
My project is to create a script that can let user open multiple folder at once, and the user can type the path that they want to create their folders in.
This is the part of the code that cause me problems.
List_length = #Filename
List_next = 1
function Main(Filename)
for List_next, List_length, List_next in
do os.execute("mkdir " .. Folderpath.. Slash .. Filename)
List_next = List_next + 1
end
SuscessMSG()
end
Main(Filename)
Problem:
Lua: <expression> expected near 'do'
I have no idea what is the problem, I have watched the documentation of Lua about expression, and I still don't understand how to solve this error.
Can someone please help me? thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这
不是有效的LUA代码。
您缺少和
do
之间的之间的表达式列表。
另外:
您要分配一个表格,然后为同一变量分配一个字符串。这将导致进一步的问题。
假设字符串列表
t
您可以简单地在元素上使用This
Is no valid Lua code.
You're missing an expression list between
in
anddo
.Also here:
You're assigning a table followed by a string to the same variable. Which will cause further problems.
Assuming a list of strings
t
you can simply iterate over the elements using