SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: pdrexel on August 19, 2006, 12:02:48 AM
-
select_line behaves differently depending on the keyboard emulation mode as documented.
Comment: this is goofy.
Here's what I'm trying to do:
Call find to search for some text
If found, start a line selection (i.e., select_line)
Call find to search for more text
If found, the selection extends (at least in Brief emulation it does)
Delete the selection with delete_selection
The above works in Brief emulation mode but not in CodeWright mode.
I have tried using brief_select_line and I have also tried _select_line but when I'm in
CodeWright mode the second find call does not extend the selection. What gives?
Is there a way to do this? If not this is a bug.
-
Maybe you could do it like this.
1. Call find.
2. int sline = p_line; save line number
3. call find again.
4. call deselect()
5. int eline = p_line; int ecol = p_col;
6. call goto_line(sline); goto_col(1);
7. call _select_char()
8. call goto_line(eline); goto_col(ecol);
9. call _select_char()
10. call delete_selection()
Graeme
-
Try this:
deselect(); // ensure re-starting selection
select_line();
search_again();
select_line(); // extend selection
delete_selection();
HS2
-
Thanks for the ideas! I've got something working now. It turns out in CodeWright mode that it is very important to call deselect after find before doinf another find.