什么是Lua
Lua是具有简单数据描述的扩展编程语言(动态解析语言)。它提供了非常好的面向对象编程, 函数式编程(functional programming),数据驱动式编程(data-driven programming), 它可以作为一个强大、轻量的脚本语言,供任何需要的程序使用。 Lua 以一个用 clean C 写成的库形式提供。(所谓 Clean C ,指的 ANSI C 和 C++ 中共通的一个子集)
Lua例子(FOR 循环)
for i=1,10 do
-- the first program in every language
io.write("Hello world, from ",_VERSION,"!\n")
end
详细描述可以参考Lua网站http://www.lua.org/about.html
背景
本例子是WTL程序(简单的HTML帮助系统),结合Lua脚本作为参数和内容的定制。
定义的Lua函数如下:
-- # MessageBox
--------------------------------------------------------
-- int MessageBox(
-- string msg, |= Message to display
-- string capition |= Capition of Box
-- );
-- Return Value:
-- if 1 the user click in OK or user close the box
-- # ShowContentPainel
-----------------------------------------------------------------
-- void ShowContentPainel(
-- bool bShow |= If true, the painel start opened, if fals