Single key Comment/uncomment

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Roger
Posts: 5
Joined: Mon Feb 16, 2004 2:14 pm

Single key Comment/uncomment

Post by Roger »

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
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

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).
Roger
Posts: 5
Joined: Mon Feb 16, 2004 2:14 pm

Post by Roger »

I will try your tools, many thanks.

The single keystroke comment/uncomment ( ' ) for bookmarked lines would be a boon for switching between realtime compiling and simulation (debugging) compiling. I hope you can update this tool at least in the near future.
User avatar
Pbufs
Posts: 9
Joined: Wed Feb 25, 2004 1:39 am
Location: Calabasas, CA

Post by Pbufs »

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.
- Joe
Post Reply