Lua for Windows 開始學習Lua程式設計
阿新 • • 發佈:2018-12-20
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 下載之後,在安裝目錄"...\Lua\5.1\SciTE"下,開啟SciTE.exe檔案,新建一個文件,儲存為"hello.lua",文件內容如下:
按下F5,在下面的輸出視窗將會有如下內容:
執行結果圖如下所示:在"...\Lua\5.1\examples"目錄下,有個"quickluatour.lua"是一些快速入門的示例。其中有個例子,是利用IupLua顯示對話方塊的,新建一個"test.lua "檔案,內容如下:
儲存。在命令提示符下輸入"lua test.lua ",回車,效果如下所示:
1 | print("hello,lua") |
123 | >lua -e "io.stdout:setvbuf 'no'" "hello.lua" hello,lua>Exit code: 0 |
1234567891011 | 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() |