Lua for Windows 開始學習Lua編程

來源:互聯網
上載者:User
        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        下載之後,在安裝目錄"...\Lua\5.1\SciTE"下,開啟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
運行結果圖如下所示:

在"...\Lua\5.1\examples"目錄下,有個"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",斷行符號,效果如下所示:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.