Author Topic: Write macro to inproved serarch  (Read 2846 times)

yhlove

  • Community Member
  • Posts: 8
  • Hero Points: 0
Write macro to inproved serarch
« on: December 31, 2007, 12:21:11 pm »
Hi

I have a problem:
- Sometimes I want to search the string under the cursor with addition of another constant string like "_STR"
- For expmale: If I press CTRL+F and the string under the cursor is "MY_NAME", I actually want to search "MY_NAME_STR"
To solve this problem I would like to write a macro that will add to the searched string another constant string like in the example above

Is it possible to write such a macro?
How can I handle the search form of slickedit within a macro code?

Thanks
Ylove

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Write macro to inproved serarch
« Reply #1 on: December 31, 2007, 02:41:45 pm »
Although it's possible to add some macro extensions to the search form it's probably too much effort.
What about using a (named) clipboard to copy the add. text to and to use 'list-clipboards' to paste it at the end of the search text ? You can use <END> to deselect and pos. the cursor properly in one step and an add key press to invoke 'list-clipboards'. I think that's not too bad and you don't need to write any macro stuff.
You can create a named clipboard e.g. by selecting the desired text and do a
copy-to-clipboard <name-of-clip>
on SE cmdline.
HS2

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Write macro to inproved serarch
« Reply #2 on: December 31, 2007, 07:59:05 pm »
Code: [Select]
#include "slick.sh"
_command find_word() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
   set_find();
   find();
}