SlickEdit Community

Archived Beta Discussions => SlickEdit 201x Beta Discussions => SlickEdit 2019 v24 Beta Discussion => Topic started by: rrvt on September 27, 2019, 07:46:46 pm

Title: _T("xxxx") Error
Post by: rrvt on September 27, 2019, 07:46:46 pm
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:

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...
Title: Re: _T("xxxx") Error
Post by: Dennis on September 27, 2019, 10:56:38 pm
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?
Title: Re: _T("xxxx") Error
Post by: jporkkahtc on September 27, 2019, 11:40:19 pm
Besides the weird issue, you can do this with a search & replace.
Search for
Code: [Select]
"([^"\r\n]*)"Replace with
Code: [Select]
_T($1)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.