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

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
主站蜘蛛池模板: 临夏县| 化隆| 陕西省| 苏州市| 嘉善县| 黔西| 惠来县| 哈尔滨市| 南皮县| 泽库县| 遂平县| 靖宇县| 石河子市| 江达县| 鹤庆县| 怀远县| 湟中县| 友谊县| 息烽县| 临清市| 深水埗区| 新蔡县| 宁河县| 房产| 乾安县| 孟州市| 双辽市| 铁力市| 周宁县| 通城县| 武胜县| 合江县| 兰州市| 聂拉木县| 乐东| 石柱| 资中县| 定结县| 蚌埠市| 宝山区| 平塘县|