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

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
主站蜘蛛池模板: 嘉黎县| 炉霍县| 枣庄市| 梅河口市| 乃东县| 阳城县| 绥化市| 惠东县| 元氏县| 丽水市| 新田县| 大冶市| 扶风县| 视频| 正镶白旗| 平顶山市| 广丰县| 韩城市| 额尔古纳市| 西乡县| 奉节县| 海晏县| 福海县| 三原县| 天等县| 宁阳县| 池州市| 子洲县| 洪江市| 新巴尔虎左旗| 洮南市| 富民县| 十堰市| 新昌县| 区。| 岱山县| 黑龙江省| 元谋县| 克什克腾旗| 固阳县| 堆龙德庆县|