T O P I C R E V I E W |
sth4nth |
Posted - Dec 15 2005 : 08:28:54 AM //str string str; str.c_str();
when I put the cursor on str on line 3, then click the "go" button to navigate to the definition, the cursor will jump to line 1 not line 2; The same thing will happen to following code: "sth"; string str; str.c_str(); |
7 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Dec 20 2005 : 3:17:09 PM now i understand the problem.
case=938 |
sth4nth |
Posted - Dec 20 2005 : 09:24:00 AM Here is a example:
string strPath=strDir+"model"; .... ....
CModel model; ...
model.dosth();
if I click "go to", it will jump to the first line of the code which definitely have no relation to the variable model. |
feline |
Posted - Dec 19 2005 : 3:54:44 PM the problem here is that VA has no way of knowing absolutely if the comment applies to the variable or not, so it is making its best guess. can you not change the case of the words in the comment?
using support's example if i change the innermost comment to read // Str then goto now goes to the definition of the variable, since the comment no longer matches the variable. |
sth4nth |
Posted - Dec 19 2005 : 02:53:29 AM but if I have such code: // "hello" ....
string hello; ....
hello.c_str();
when I click the "go to", I want to go to the definition. "hello" in the comment maybe for other purpose not for the variable hello. |
support |
Posted - Dec 18 2005 : 10:25:45 AM Jumping to the "first place that str appears" not something VA X would do. VA X is usually quite smart.
We tested your example again and understand what is happening. VA X assumes the comment describes str so it assumes you want to go there.
VA X will not take you to a comment with str outside the scope of str.
Try Goto on each str in the following example, then change the comment lines to see the VA X is still doing the right thing.
|
sth4nth |
Posted - Dec 18 2005 : 02:25:59 AM //str
string str; str.c_str();
Here, I mean some string in the comment is the same with a variable name("str" above), Then the "go to" will jump to the comment line.
I guess the error is caused by jumping to the first place that "str" appear in the file. |
support |
Posted - Dec 15 2005 : 5:52:55 PM We try your example with 1437 inside VS.NET 2003 and Goto leaves the caret at line 2.
Can you reproduce the problem in a small file? Near the top of your current file? (Maybe something in the current file gets the VA X line count off by one.)
|