|
Re: Variable defined: msg#00117lang.groovy.user
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> |
|---|---|---|
| Previous by Date: | Re: Extension as first class construct, Jeremy Rayner |
|---|---|
| Next by Date: | Re: Extension as first class construct, Michael Latta |
| Previous by Thread: | Variable defined, juhani |
| Next by Thread: | Re: Variable defined (or not), juhani |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |