BUG: Match Brace Command Foiled by String/Character LiteralsID: Q166946
|
The matching brace feature of the Text Editor (the GoToMatchBrace and
GoToMatchBraceExtend commands) fails if code contains curly braces ({}),
square brackets ([]), angle brackets (<>), or parentheses as literals. For
example:
void test()
{
TCHAR szBar[] = _T("{");
TCHAR chBar = _T('{');
}
The editor keeps a count of the brace (or other character) it is trying to match as it scans the code. It does not recognize language tokens, so it cannot skip strings.
You can work around this by coding the brace (or other character) using an
octal or hex escape sequence, instead of a literal. For example:
"{"
"\x7B"
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
Additional query words:
Keywords : kbide kbVC kbVC500bug kbVC600bug kbVisID100bug kbVisID600bug kbVJ110bug kbVJ600bug kbVS97bug kbVS600bug kbGrpDSTools
Version : WINDOWS:1.0,1.1,6.0,97; winnt:5.0,6.0
Platform : WINDOWS winnt
Issue type : kbbug
Last Reviewed: April 17, 1999