Hi
I am new to programming with textpad. Is it possible to set bookmarks at multiple single lines and using a single keystroke comment lines in with a single apostrophe ' at the beginning of each bookmarked line. Same again for uncommenting. Macros are no good as they have to be re-recorded if a bookmark is changed.
TIA
Roger
Single key Comment/uncomment
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
a collection of tools I need to update which included "Bookmark replace" It limits a replace operation to bookmarked lines. If regular expressions are used, something like this might achieve your goal (untested):
Find What: ^
Replace with: ' &
I'll keep your request in mind when I get around to updating the tools (soon I hope).
Find What: ^
Replace with: ' &
I'll keep your request in mind when I get around to updating the tools (soon I hope).
I did this by using recording a macro.
1) Select a block of text.
2) Start recording the macro.
3) Hit F8 (or whatever your replace keystroke is set to).
4) Type "^" (without the double quotes) in the Find what: field.
5) Hit Tab to select the Replace with: field.
6) Type "--" in the Replace with: field.
7) Make sure Regular Expression is checked and Selected text is selected.
8) Hit Alt-A to Replace All.
9) Stop recording the macro.
10) Save, blah, whatever, and map it to a keystroke.
Sadly, I haven't figured out a way to make it uncomment with the same keystroke, so I have a second macro to uncomment that uses Find what: "^--" and Replace with: "".
I hope that is useful.
1) Select a block of text.
2) Start recording the macro.
3) Hit F8 (or whatever your replace keystroke is set to).
4) Type "^" (without the double quotes) in the Find what: field.
5) Hit Tab to select the Replace with: field.
6) Type "--" in the Replace with: field.
7) Make sure Regular Expression is checked and Selected text is selected.
8) Hit Alt-A to Replace All.
9) Stop recording the macro.
10) Save, blah, whatever, and map it to a keystroke.
Sadly, I haven't figured out a way to make it uncomment with the same keystroke, so I have a second macro to uncomment that uses Find what: "^--" and Replace with: "".
I hope that is useful.
- Joe