-
Notifications
You must be signed in to change notification settings - Fork 0
script files
Andrey Vakhterov edited this page Jul 14, 2015
·
1 revision
All script files are located in directory plugins/VarScript/scripts
with extension groovy
.
File name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign $
, or the underscore character _
.
File example: plugins/VarScript/scripts/doTest.groovy
:
println "doTest is called"
for (def arg in args) {
println arg
}
Call script without parameters:
/> doTest
/> doTest()
Call script with parameters:
/> doTest "foo", 1, me
/> doTest("foo", 1, me)
You can call script file from another script file or recursive.
Example, plugins/VarScript/scripts/factorial.groovy
:
int value = args[0]
if (value <= 0) return 1
else return value * factorial (value-1)
/> println factorial(5) // prints 120