14 Jun 2004 12:12
Re: global variables
On 14 Jun 2004, at 11:02, Lendvai Attila wrote: > hi! > > I'm playing with an ant replacement based on groovy, and I would like > to > be able to easily define global variables. > > If I'm right currently the only way is to define a Globals class with > public statics or something similar. > > Maybe Binding.setProperty()? > > any toughts? thanks in advance, Depends what you mean by global variables. Certainly you can define static fields/properties in a class. Or if you're writing a script you can set properties on a Binding and then pass those into a script - or return values from a script into the binding. e.g. http://groovy.codehaus.org/Embedding+Groovy James ------- http://radio.weblogs.com/0112098/
RSS Feed