Author |
Topic |
|
Racey
Senior Member
USA
25 Posts |
Posted - Mar 09 2004 : 7:03:16 PM
|
This seems to be a case where programming style and VA collide.
I'm working with files written by a co-worker whose coding style is to have first level statements unindented. So, his code looks something like this:
void funct1() { int a;
a = 1; if (a) { a = 0; } }
int funct2() { static int b = 0;
if (b == 100) { b = 0; } else { b++; } return b; }
My problem is the VA Context dropdown list may not reveal the function names beyond the first. It might display as
funct1 if
rather than
funct1 funct2
Files with many methods might display a few function names scattered through a list of conditionals--It will display only the first conditional in the function, the statement is "if," "while," "for," "switch," and etc. It doesn't appear random, as the functions will be listed the same way each time the file is closed and re-opened.
David |
|
support
Whole Tomato Software
5566 Posts |
Posted - Mar 09 2004 : 7:59:46 PM
|
We pasted your example into a cpp file and the "List of methods in current file" appears fine. We get funct1 and funct2.
Do we not understand the problem?
Might you have over-simplified the example? Does the dropdown work if you paste your own example into a different cpp file?
Use the [ code] and [ /code] tags in a post, without the space after the [, to show us exact formatting. |
Whole Tomato Software, Inc. |
|
|
Racey
Senior Member
USA
25 Posts |
Posted - Mar 10 2004 : 12:54:05 PM
|
Yeah, it appears this over simplified it. I will try getting a screen shot later on today. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Mar 10 2004 : 1:52:44 PM
|
Try for a code sample that reproduces the problem. We believe it exists. We just need a way to reproduce it. |
Whole Tomato Software, Inc. |
|
|
Racey
Senior Member
USA
25 Posts |
Posted - Mar 10 2004 : 3:45:48 PM
|
I looked over the code and found out when it occurs. I was able to reproduce it thus:
struct testing { int one; };
void funct1() { struct testing a; a.one = 1; if (a.one) { funct2(a); } }
void funct2(*tester) struct testing *tester; { int b; b = tester->one; if (b) { b++; } }
The list displays funct1, but funct2 appears as "if." In the code I inherited and I see this occuring, sure enough, every method where the conditional is the representative, the method is defined with the style of funct2.
This brings me to another issue. VA fails to identify the parameter in funct2--That is, the definition box appears blank. Auto-complete will not work and, if the parameter is a class or struct, no list of members gets displayed. When I typed the sample above, it worked fine for a second, then decided tester was not recognized in funct2. |
|
|
|
Topic |
|