通过lua自带例子学习lua 08 (36-38)

-- Example 36 -- Standard Libraries - operating system facilities.

-- OS functions:
-- os.clock, os.date, os.difftime, os.execute, os.exit, os.getenv,
-- os.remove, os.rename, os.setlocale, os.time, os.tmpname

print(os.date())


-------- Output ------

04/06/13 16:30:52

-- Example 37 -- External Libraries.

-- Lua has support for external modules using the 'require' function
-- INFO: A dialog will popup but it could get hidden behind the console.

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()


-------- Output ------

Exit GUI app to continue!
-- Example 38   --[[

 To learn more about Lua scripting see

 Lua Tutorials: http://lua-users.org/wiki/TutorialDirectory

 "Programming in Lua" Book: http://www.inf.puc-rio.br/~roberto/pil2/

 Lua 5.1 Reference Manual:
     Start/Programs/Lua/Documentation/Lua 5.1 Reference Manual

 Examples: Start/Programs/Lua/Examples
]]

 

posted on 2013-04-06 16:35  cv_ml_张欣男  阅读(319)  评论(0编辑  收藏  举报

导航