-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
Witherbear edited this page Mar 10, 2023
·
1 revision
Functions are code that can be executed. A example of functions is the main function.
In the DonutScript programs, we can or not use functions. Here's a example of a function:
fun main():
println("is a functionnnn")
endFunctions can have arguments. Arguments are variables that functions have stored, but without any data. Example:
-- arguments can also be printed in console
fun simplefunc(arg):
println(arg)
endTo use functions, we just type the name of function and the "()":
-- we can define arguments using functions
simplefunc("argument1")DonutScript Wiki | @flash_content
- Home
- DonutScript
- Begginer's Guide
- Concepts
- Functions
- Hello DonutScript!
- LearnDonut
- DonutScript Compiler