logo       

Re: Variable defined: msg#00117

lang.groovy.user

Subject: Re: Variable defined

On Fri, Oct 15, 2004 at 04:28:58AM -0700, juhani wrote:
> Hi! How do you test if variable is defined or not?

Hi, not sure of the context in which you're thinking,
but inside a groovy script all variables are an object
so a simple test for null should do the trick

if (foo != null) {
println foo
} else {
println "foo is undefined"
}


Hope that helps

Jez.



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise