'Increment index without show its value on xtend
I'm trying to generate some code with a xtend function , that function uses foor loop that with variable that its increemented , the problem is that that the value of the variable is shown on the generated file, how I can avoid it?
def codeGenerate(users u) '''
«var index = 0»
«FOR user :u»
«index +=1» //The problem is here the value of index is printed, how I can incremet the value without printing it?
«ENDFOR»
'''
Solution 1:[1]
It's not nice but this should do the trick:
«{index +=1; null}»
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
