Jump to content

Runtime evaluation: Difference between revisions

Line 72:
 
====GString embedded values====
ThisSetting up the script as a '''GString''' with embedded value parsing is a "natural" ''ad hoc'' solution for Groovy programmers, but it doesthere entailare somepossible problemspitfalls if the script itself contains '''GString'''s.
<lang groovy>def startYear = 2008
def endYear = 2121
Line 84:
The variables "startYear" and "endYear" are dynamically pulled into the script '''GString''' as embedded values.
 
Notice that in the script the embedded value "${it}" must be ''quoted'' with backslash (\) to prevent parsing as a part of the script '''GString'''. However, it is still correctly parsed within the internal '''GString''' when the script is run.
 
====Binding variables====
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.