Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,9 @@
put zeroArgsFn()
// Function calls can also be made using the following syntax:
put the zeroArgsFn
function zeroArgsFn
put "This function was run with zero arguments."
return "Return value from zero argument function"
end zeroArgsFn

View file

@ -0,0 +1,15 @@
put TwoArgFn("variable", (3, 4)) into _
// Alternatively, the function can be called like so:
put the TwoArgFn of "variable", (3, 4)
// The parameter list is flexible, allowing any amount of variable to be passed in.
// These can be accessed with the keyword `the parameterList`
// The specified parameters only limits to named parameters
get TwoArgFn("variable", (3, 4), "hello")
get the TwoArgFn of "variable", (3, 4), "hello"
function TwoArgFn arg1, arg2
put "2 argument function: arg1 = " & arg1 & "; arg2 = " & arg2
put "Parameters = " & the parameterList
end TwoArgFn

View file

@ -0,0 +1,5 @@
get ThreeArgFn("variable", (3, 4))
function ThreeArgFn arg1, arg2, arg3
put "3 argument function: arg1 = " & arg1 & "; arg2 = " & arg2 & "; arg3 = " & arg3
end ThreeArgFn

View file

@ -0,0 +1,9 @@
get OneArgFn() -- arg1 is 5
get OneArgFn(10) -- arg1 is now 10
function OneArgFn arg1
if arg1 is ""
set arg1 to 5
end if
put "One argument function; arg1 = " & arg1
end OneArgFn

View file

@ -0,0 +1,13 @@
put 3 into a
get AddOne(a)
put "Value of a = " & a
// Value of a = 3
put 5 into b
get AddOne(container b)
put "Value of b = " & b
// Value of b = 6
function AddOne n
add 1 to n
end AddOne

View file

@ -0,0 +1,6 @@
CustomHandler 1, 2, 3
// Prints: 1 - 2 - 3
to handle CustomHandler arg1, arg2, arg3
put arg1 && "-" && arg2 && "-" && arg3
end CustomHandler

View file

@ -0,0 +1,5 @@
MyCommand 1, "variable", (4, 5, 6)
to MyCommand args
...
end MyCommand

View file

@ -0,0 +1,11 @@
to MyFn args
...
end MyFn
function MyFn args
...
end args
on MyFn args
...
end args