Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
In eclipse (java) Window->Preferences->Java->New new templates can be created. In the field "Pattern" I entered System.out.println("DEBUG ${label}"); ${cursor} I like old-style debug...
#3: Post edited
- In eclipse (java) Window->Preferences->Java->New new *templates* can be created.
- In the field "Pattern" I entered
- ```
- System.out.println("DEBUG ${label}");
- ${cursor}
- ```
- I like old-style debugging, so I use a lot statements like `System.out.println("DEBUG A");` ... `System.out.println("DEBUG Z");`.
- The question is, can (and if so, how) I have the variable `${label}` to be permanent and auto-increasing?
- So that calling it first time, it has value "A", second time "B" and so on.
The question is not restricted to the use-case above, templates are a mighty tool, if you know how to use it.Not sure if the tag **template-metaprogramming** is used as intended.
- In eclipse (java) Window->Preferences->Java->New new *templates* can be created.
- In the field "Pattern" I entered
- ```
- System.out.println("DEBUG ${label}");
- ${cursor}
- ```
- I like old-style debugging, so I use a lot statements like `System.out.println("DEBUG A");` ... `System.out.println("DEBUG Z");`.
- The question is, can (and if so, how) I have the variable `${label}` to be permanent and auto-increasing?
- So that calling it first time, it has value "A", second time "B" and so on.
- The question is not restricted to the use-case above, templates are a mighty tool, if you know how to use it.
#2: Post edited
eclipe templates -- creating and setting a permanent variable
- eclipse templates -- creating and setting a permanent variable
#1: Initial revision
eclipe templates -- creating and setting a permanent variable
In eclipse (java) Window->Preferences->Java->New new *templates* can be created.
In the field "Pattern" I entered
```
System.out.println("DEBUG ${label}");
${cursor}
```
I like old-style debugging, so I use a lot statements like `System.out.println("DEBUG A");` ... `System.out.println("DEBUG Z");`.
The question is, can (and if so, how) I have the variable `${label}` to be permanent and auto-increasing?
So that calling it first time, it has value "A", second time "B" and so on.
The question is not restricted to the use-case above, templates are a mighty tool, if you know how to use it.
Not sure if the tag **template-metaprogramming** is used as intended.
