加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Lua for Windows 开始学习Lua编程

发布时间:2020-12-14 22:19:54 所属栏目:大数据 来源:网络整理
导读:? ? ? ? Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows.这是在Windows上学习Lua的整套开发环境,包含Installer Lua Interpreter,Lua Reference Manual,Quick Lua Tour Sample,Examples directory,Libra
? ? ? ? Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows.这是在Windows上学习Lua的整套开发环境,包含Installer Lua Interpreter,Lua Reference Manual,Quick Lua Tour Sample,Examples directory,Libraries with documentation. Lua Compiler (luac) Text Editors (SciTE and I think maybe wxLua editors too) C header files/libraries/etc. for building C module
项目地址: http://code.google.com/p/luaforwindows/
当前版本:5.1.4-45


? ? ? ? 下载之后,在安装目录" ...Lua5.1SciTE"下,打开 SciTE.exe文件,新建一个文档,保存为" hello.lua",文档内容如下:
1
print( "hello,lua")
按下F5,在下面的输出窗口将会有如下内容:?
1
2
3
>lua?-e?"io.stdout:setvbuf?'no'"?"hello.lua"??
hello,lua
>Exit?code:?0
运行结果图如下所示:


在" ...Lua5.1examples"目录下,有个" quickluatour.lua"是一些快速入门的示例。其中有个例子,是利用 IupLua显示对话框的,新建一个" test.lua"文件,内容如下:?
1
2
3
4
5
6
7
8
9
10
11
require(? "iuplua"?)
ml?=?iup.multiline
????{
????expand= "YES",
????value= "Quit?this?multiline?edit?app?to?continue?Tutorial!",
????border= "YES"
????}
dlg?=?iup.dialog{ml;?title= "IupMultiline",?size= "QUARTERxQUARTER",}
dlg:show()
print( "Exit?GUI?app?to?continue!")
iup.MainLoop()
保存。在命令提示符下输入" lua test.lua",回车,效果如下所示:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读