Archived Beta Discussions > SlickEdit 2019 v24 Beta Discussion

_T("xxxx") Error


I am using the v24 beta.  I am moving some of my code from Ansi characters to Unicode (yuk).  In the process of doing that I need to add _T(...) around literal strings so that the code can be compiled with just 8 bit characters and with 16 bit characters.  The problem comes when I add _T( to and existing string.  Here is what happens:

* The string is "abc"
* Adding _T( at beginning of string yields:
* _T(")abc"
Notice where the automatic right parenthesis winds up (inside the string literal!).  When I add the closing right parenthesis after the c" the compiler is fine with the result but the code then doesn't produce what I want...

I am having trouble reproducing this problem.  This looks like the sort of thing that would be very dependent on your configuration.  Could you post your user.cfg.xml (from your SlickEdit configuration directory).  A few more questions:

1) Is _T() defined in your project?
2) What is your exact sequence of keystrokes?
3) Does auto-complete come up, or any other code help dialogs (such as function argument help)?
4) I assume you are encountering this in C or C++ language mode?

Besides the weird issue, you can do this with a search & replace.
Search for

--- Code: ---"([^"\r\n]*)"
--- End code ---
Replace with

--- Code: ---_T($1)
--- End code ---
Using Perl RegEx

Works well, unless you have embedded quotes in a string.

You can also just prefix with L, as in L"This is a wide string".
You will never go back to ascii, so there is little point to using the _T() macro.


[0] Message Index

Go to full version