rdevet (1) [Avatar] Offline
I tried to run this listing but it complained on clinksWithGuest. So i had to put def in front of it. Is it a typo?
Mittie (397) [Avatar] Offline
Re: listing 2.5

the code works fine as long as you run the listing 'as is', i.e. inside the groovyConsole, groovysh, or as a script via "groovy myListing" from the command line. Only if you put the listing code inside a class, then you have to def your variables.

See also: "7.1.1 Defining fields and local variables".

thanks for posting and a happy new year