- Lua Quick Start Guide
- Gabor Szauer
- 85字
- 2021-08-05 10:30:39
Calling a function
Once a function is declared, it can be executed by calling it. To call a function, simply type its name, followed by parentheses. For example, to read input from the console, you call io.read(). The following snippet demonstrates how to declare and call your own function:
print ('about to declare the PrintSomething function');
function PrintSomething() -- declare the function
print ('hello, world')
end
print ('the PrintSomething function is declared');
print ('calling the PrintSomething function');
PrintSomething(); -- call the function
print ('called the PrintSomething function');
推薦閱讀
- Boost.Asio C++ Network Programming(Second Edition)
- JBoss Weld CDI for Java Platform
- Practical Data Analysis Cookbook
- Learning Cython Programming
- 數字媒體應用教程
- Drupal 8 Blueprints
- 程序員面試算法寶典
- OpenCV for Secret Agents
- HTML5 Mobile Development Cookbook
- Drupal 8 Module Development
- 微信小程序項目開發實戰
- JavaCAPS基礎、應用與案例
- jQuery炫酷應用實例集錦
- 計算機應用基礎項目化教程
- Hacking Android