Skip to main content

Groovy: hide print out

If a variable in groovy is set and nothing is done with it it will be printed out instantly. To avoid this do something like this:

{{groovy}}
  // Because velocitys mathtool isn't working create random number with groovy and use $count as max. value
  // velocity "$count" is groovy "count"
  randomnumber = Math.abs(new Random().nextInt() % count)
  // following line prevents print out of randomnumber
  assert randomnumber instanceof Integer
{{/groovy}}