SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: Dan112123 on November 19, 2008, 07:03:36 PM
-
Does anyone have a macro that would surround all strings in a file with TEXT(). seems like a very useful macro to have.
-
Try recording one using the color coding option in the find dialog to search for a string, then search for quotes, insert whatever text you want etc.
Graeme
-
Not sure what you mean exactly, I've tried several things with color and quotes and non of them give me the results I want. Which is
I have string like this "some string" and after I run the macro I want it to look like this _T("some string"). Note that all of the string are different.
-
Just experiment. In a simple case:
- Start macro recording
- Open the search dialog
- Use a regular expressiong search for .+, click the Colour button and select String. Click enter
- This will take you to a string.
- Type _TEXT(
- Hit end
- Type)
- Stop recording the macro and save it.
Now replay the macro. It will step through all strings in the file.
This will not work for all cases, its just to give you the jist of it.
-
A slight adjustment to lambertia's list - instead of "hit end", do a search for "not string" to find the end of the string - the color coding thing lets you do that.
Graeme
-
That's nice I didn't know that!