New ScreenPanel
This commit is contained in:
31
script/script.groovy
Executable file
31
script/script.groovy
Executable file
@@ -0,0 +1,31 @@
|
||||
|
||||
def function(a){
|
||||
a*2
|
||||
}
|
||||
//evaluate (new File("calc.groovy"))
|
||||
//evaluate (new File("cls.groovy"))
|
||||
|
||||
println "--------------"
|
||||
|
||||
lib.load "calc"
|
||||
cls = lib.load "cls"
|
||||
|
||||
|
||||
//This is how to load a new class dinamically
|
||||
// ClassLoader parent = lib.class.getClassLoader();
|
||||
// groovy.lang.GroovyClassLoader loader = new groovy.lang.GroovyClassLoader(parent);
|
||||
// Class cls = loader.parseClass(new File("script\\cls.groovy"));
|
||||
|
||||
|
||||
println dev.get()
|
||||
println dev2.val
|
||||
println calc(6)
|
||||
|
||||
|
||||
//cls = Class.forName('cls')
|
||||
//obj = new cls()
|
||||
obj = cls.newInstance()
|
||||
println obj.val
|
||||
obj.exec()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user