OPOPO
OPOPO

Reputation: 503

Netbeans code templates with changing value

Is it possible to create code template that will use written value?

simple example:

firstly: while + tab gives standard while code.

I would like to create something where while 100 + tab would give:

while (i<100) {

}

Where 100 is given value and can be different. Also would be nice to have more than one custom value.

Upvotes: 0

Views: 48

Answers (1)

Jean Waghetti
Jean Waghetti

Reputation: 4727

Go to Tools -> Options.

Then click on Editor and go to Code Templates tab.

Click New, give and abbreviation and the code template.

Look at the existing templates, like whilexp - it shows how to prompt for input on the code template.

Upvotes: 1

Related Questions