22 Apr 2004 20:57
Re: Calling scripts within scripts
On 22 Apr 2004, at 19:20, John Stump wrote:
> I tried using GroovyShell, but it doesnt' seem to evaluate the
> file in the current context. My example below doesn't work; it
> seems to create a new shell and evaluates the file in that
> context, and then returns...
We don't support exposing a class's internal variable scopes as the
current context when evaluating execute.
You could try passing 'this' into the script.
shell = new GroovyShell()
shell.outer = this
shell.execute(new File("foo.groovy"))
// then in foo.groovy
outer.a = 123
James
-------
http://radio.weblogs.com/0112098/
RSS Feed