- Lua Quick Start Guide
- Gabor Szauer
- 159字
- 2021-08-05 10:30:39
Defining a function
A function declaration starts with the function keyword. After the function keyword, you provide the function name. The name of the function follows the same naming rules as the name of a variable.
After the name of your function, you have to provide a list of parameters. Parameters are variable names enclosed in parentheses (). The list of parameters may be empty if a function needs no parameters, in which case only opening and closing parentheses are given—().
Once you have declared the list of parameters, you may write the body of the function. The function body is a chunk of code, so like other chunks you need to close the body with the end keyword. The following code demonstrates a simple function:
function PrintSomething()
text1 = "hello"
text2 = "world"
print (text1 .. ", " .. text2)
end
This function definition can be broken down into the following parts:

- PWA入門與實踐
- Windows系統管理與服務配置
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- PyTorch自然語言處理入門與實戰
- 趣學Python算法100例
- DevOps入門與實踐
- Mastering Unity Shaders and Effects
- 零基礎輕松學SQL Server 2016
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- SQL Server與JSP動態網站開發
- Android應用開發實戰
- Solutions Architect's Handbook
- App Inventor 2 Essentials
- Python數據可視化之美:專業圖表繪制指南(全彩)
- UI動效設計從入門到精通