Live-Template question

I want to create a live-template to create simple count-loops. Looks like:

for(int $INDEX$ = 0; $INDEX$ < $NUM$; $INDEX$++) {
$END$
}

with

$INDEX: suggestIndexName()
$NUM: variableOfType(int)

If I use the template, it always chooses the index variable for $NUM what of course isn't what I want, it should choose the nearest integer variable outside the new for-loop.

Any suggestions?

2 comments
Comment actions Permalink

You could try moving INDEX down to below NUM in Edit Variables.

Karsten Wagner wrote:

I want to create a live-template to create simple count-loops. Looks like:

for(int $INDEX$ = 0; $INDEX$ < $NUM$; $INDEX$++) {
$END$
}

with

$INDEX: suggestIndexName()
$NUM: variableOfType(int)

If I use the template, it always chooses the index variable for $NUM what of course isn't what I want, it should choose the nearest integer variable outside the new for-loop.

Any suggestions?

0
Comment actions Permalink

Don't works. It always chooses the variable it created for $INDEX as default.

0

Please sign in to leave a comment.