SlickEdit Product Discussion > Slick-C® Macro Programming

macro functions search vs find


I am pretty sure this question must have been asked before, but I can not find the answer.
What is the difference between the search() and find() functions?

If search looks like it does what you want you should call search rather than find  - it's a low level built in function that is called from find.  Lots of slick c code calls search but very little calls find.  The search command does very little apart from searching for a string in a buffer  - it looks like it can set up highlighting in the buffer (the # option) but it mostly doesn't affect the state of the editor.  The find command sets up default search options and fiddles with search options and selections, sets the mouse cursor to "busy" and handles multiple cursors plus it handles interactive command line search.

If you type
fp search
on the slick command line it will take you to builtins.e where you will find a prototype but no implementation.  The implementation is in the slick core (C++ code).  The file builtins.e is never compiled - it exists purely to help with tagging and show function call options etc.

If you type
fp find
you will see the implementation of the find function in search.e.

Also have a look at SlickCMacroBestPractices.pdf in the installation folder if you're new to macros.

@Graeme - Thanks for a prompt answer!


[0] Message Index

Go to full version