- 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');
推薦閱讀
- Oracle WebLogic Server 12c:First Look
- Web應用系統開發實踐(C#)
- Kali Linux Web Penetration Testing Cookbook
- Progressive Web Apps with React
- Mastering Kali Linux for Web Penetration Testing
- 手把手教你學C語言
- Learning Selenium Testing Tools(Third Edition)
- Multithreading in C# 5.0 Cookbook
- INSTANT Yii 1.1 Application Development Starter
- JavaScript機器人編程指南
- C++從入門到精通(第6版)
- Machine Learning for Developers
- Vue.js光速入門及企業項目開發實戰
- Hack與HHVM權威指南
- 3D Printing Designs:Octopus Pencil Holder