Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Call-a-function/Cubescript/call-a-function.cube
Normal file
16
Task/Call-a-function/Cubescript/call-a-function.cube
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// No arguments
|
||||
myfunction
|
||||
|
||||
// All functions can take a variable number of arguments.
|
||||
// These can be accessed from within the function with the aliases:
|
||||
// $arg1, $arg2, $arg3... $numargs tells the amount of args passed.
|
||||
myfunction word "text string" 1 3.14
|
||||
|
||||
// Getting a function's return value
|
||||
retval = (myfunction)
|
||||
|
||||
// Trying to do a variable lookup on a builtin function will return an empty
|
||||
// string. This can be used to distinguish builtin functions from user-defined
|
||||
// ones.
|
||||
if (strcmp $echo "") [echo builtin function] // true
|
||||
if (strcmp $myfunction "") [echo builtin function] // false
|
||||
Loading…
Add table
Add a link
Reference in a new issue