官术网_书友最值得收藏!

if

A logical control structure always starts with an if statement. As described previously, an if statement consists of the if keyword, a Boolean expression, and a then/end chunk. The then/end chunk is only executed when the Boolean condition evaluates to true. The following code sample demonstrates the basic use of an if statement:

print ("Enter your name")
name = io.read()

if #name <= 3 then
print ("that's a short name, " .. name)
end
主站蜘蛛池模板: 桑植县| 云安县| 靖江市| 华容县| 顺平县| 大兴区| 容城县| 福建省| 望谟县| 惠安县| 丰宁| 上林县| 大关县| 枣强县| 砀山县| 都江堰市| 淮安市| 万盛区| 白沙| 二手房| 图木舒克市| 平武县| 白朗县| 台南县| 镇安县| 曲靖市| 神木县| 荔波县| 泸州市| 日照市| 章丘市| 白山市| 隆德县| 库尔勒市| 莎车县| 驻马店市| 开化县| 博客| 襄樊市| 绥滨县| 毕节市|