SlickEdit Community

SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: Dan112123 on November 19, 2008, 07:03:36 PM

Title: Macro to surround strings with TEXT(), _T()
Post 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.
Title: Re: Macro to surround strings with TEXT(), _T()
Post by: Graeme on November 19, 2008, 09:06:56 PM
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
 
Title: Re: Macro to surround strings with TEXT(), _T()
Post by: Dan112123 on November 19, 2008, 11:48:44 PM
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.
Title: Re: Macro to surround strings with TEXT(), _T()
Post by: lambertia on November 20, 2008, 12:56:40 AM
Just experiment. In a simple case:


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.
Title: Re: Macro to surround strings with TEXT(), _T()
Post by: Graeme on November 20, 2008, 02:41:23 AM
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
Title: Re: Macro to surround strings with TEXT(), _T()
Post by: lambertia on November 20, 2008, 02:51:45 AM
That's nice I didn't know that!