1、创建一个name为BooleanStudy的lua脚本
脚本内容:
--true
if true then
print("true,execute print")
end

2、点击LDT工具栏上的bug(小甲虫)按钮右侧第一个 绿色三角 按钮来运行Lua脚本

3、执行结果:
true,execute print

4、脚本内容:
--false
if false then
print("execute print when false")
end

5、执行结果:没有输出。
当条件为false时,打印语句不会执行

6、脚本内容:
--数字0
if 0 then
print("execute print when 0")
end

7、执行结果:
execute print when 0

8、Lua中if条件为数字1时,即为true,打印语句会执行。
脚本内容:
--数字1
if 1 then
print("execute print when 1")
end
执行结果:
execute print when 1

9、Lua中if条件为nil时,即为false,打印语句不会执行
脚本内容:
--nil
if nil then
print("execute print when nil")
end
执行结果:没有输出。
