02-12-2010 04:07 AM
Hi,
I regulary encounter the fact that within the CVI editor, the + marks indicating a collapsible region do not show at all or at the wrong position, indicating that the refresh is working too slow or not at all. I am attaching a sample picture. The red region indicates that there should be a plus sign because some minutes ago I had collapsed the corresponding if structure which now is gone. I cannot make it appear again without restarting CVI.
Wolfgang
Solved! Go to Solution.
02-12-2010 04:35 PM
What happens if you do "expand all" from the View -> Collapsible Regions -> expand all pull-down menu.
Menchar
02-14-2010 04:51 AM
Hi Menchar,
Thanks for pointing me to the View menu, I wasn't aware of this new entry... I will try it the next time I encounter this behavior and let you know.
In the mean time, I can add some more information:
1) It appears to me that the collapse indicators are refreshed only after the cursor reaches the corresponding line, see the figure below
Obviously, the markers are misplaced (because I have scrolled the window which did not get repainted); the markers only disappear if I move the cursor to or beyond the line showing the marker; i.e. the marker remains in its position while the code is scrolled, and the marker position is updated only later
2)Using the newly discovered Collapse all from the View menu almost all regions are collapsed, except one, see below:
so all functions have been collapsed and I can see no reason why this QuitCalback function did not get collapsed, too. The code is fine without any errors.
Any ideas?
Wolfgang
02-15-2010 10:54 AM
Nope. Can't explain it. I did a collapse all in one of my modules with 20+ functions and every one of them collapsed, included the ones that were commented out. Exapnsion works OK too.
Maybe a cut and paste carried some sort of region tag with it that has the region logic goofed up.
I am using CVI 9.1.0 (427)
02-15-2010 03:16 PM
Hi Menchar,
thanks for looking into it. I am using the same CVI version as you do. I tried the same procedure on my computer at home where I encounter the same problem, see below. Btw, I am not aware of any region tags in my code.
02-15-2010 03:26 PM
Wolfgang -
That function is collapsed - the collapsed region is bounded by the curly braces, what's making it look funny is that for that second callback you've got the function definition spread across several lines due to the parameters being one per line.
Menchar
02-15-2010 04:28 PM
02-15-2010 04:37 PM
I did it :
int CVICALLBACK QuitCallback ( int panel,
int control,
int event,
void *data,
int event1,
int event2) { return 1;}
{
}
in this case the region icon is not on the function but rather on the unrelated block below it. So unless you've got a function block spanning more than one line it doesn't get collapsed or exapnded.
In a pure block,
{
}
will not collapse, but
func (int param)
{
}
will.
02-16-2010 02:04 AM
Hi Menchar,
Thanks! Still I am not sure that my problem is what you found out...
OK, here is the structure of the function and I have to say: collapsing works under one certain condition: this condition is that I remove the preceding function.... In other words, the collapse algorithm already is confused when arriving at this function...
So what makes the collapse algorithm getting confused? After this new insight I have to say: the preceding StartCallback is a function with more than 3000 lines - so I presume that some CVI internal stack taking care of opening and closing braces might have suffered an overflow. Hence it would be nice to hear some opinion from NI 🙂
int CVICALLBACK QuitCallback ( int panel,
int control,
int event,
void *callbackData,
int eventData1,
int eventData2 )
{
if ( __ )
{
if ( __ )
{
;
if ( __ )
{
;
}
QuitUserInterface ( 0 );
}
else
{
;
}
}
return ( 0 );
}
02-16-2010 11:09 AM
Sounds like that might be the problem, the collapse algorithm can't tell that the QuitCallback function isn't part of the preceding function maybe because it's overflowed its ability to track nested blocks.
I wouldn't hold my breath waiting for NI - this problably isn't a burning platform issue for them.
Menchar