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

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
主站蜘蛛池模板: 廉江市| 永丰县| 饶平县| 伊通| 筠连县| 湘潭市| 彩票| 资阳市| 宾阳县| 聊城市| 无锡市| 阜康市| 澄城县| 弋阳县| 南陵县| 高邑县| 荥经县| 龙游县| 化隆| 滨海县| 泌阳县| 杨浦区| 夏河县| 清丰县| 曲麻莱县| 乌什县| 偃师市| 洛宁县| 锡林浩特市| 云安县| 同心县| 安康市| 武胜县| 乐陵市| 儋州市| 阿鲁科尔沁旗| 资阳市| 怀来县| 汤阴县| 百色市| 绥宁县|