- Lua Quick Start Guide
- Gabor Szauer
- 75字
- 2021-08-05 10:30:42
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
推薦閱讀
- 大學(xué)計算機基礎(chǔ)(第三版)
- Practical Internet of Things Security
- OpenCV for Secret Agents
- JavaScript從入門到精通(第3版)
- MySQL數(shù)據(jù)庫管理與開發(fā)(慕課版)
- 深入淺出PostgreSQL
- Tableau 10 Bootcamp
- Swift 4從零到精通iOS開發(fā)
- Visual Basic 6.0程序設(shè)計實驗教程
- Django 3.0入門與實踐
- Python機器學(xué)習(xí)算法與應(yīng)用
- 汽車人機交互界面整合設(shè)計
- 分布式數(shù)據(jù)庫原理、架構(gòu)與實踐
- Flink技術(shù)內(nèi)幕:架構(gòu)設(shè)計與實現(xiàn)原理
- Machine Learning for OpenCV