xtend

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

  • It's not nice but this should do the trick:

    «{index +=1; null}»