Page 1 of 1

Code folding error not entirely correct & initializers

Posted: 21 Nov 2008 00:43
by sadavis80
I find that breakpoints stay in the same screen POSITION instead of moving with the 'breakpointed' line *ANY* time you add or delete lines in the source. The code appears to 'break' where the BP line USED TO BE. So the execution pointer agrees with the code that's being executed (at least according to the watch window), but the previously BP'd line no longer 'owns' the breakpoint. If you CLEAR the breakpoint(s) and reset them, all goes back to normal (more or less)... well, you have to CLEAR, *THEN* compile, *THEN* reset the BP.... WELL - it seems you have to CLEAR *ALL* BP's to be sure, then Compile and reset...

I also find that you cannot (apparently) combine multiple declarations on the same line - at least if you are initializing. i.e.
char t[] = "test";
char t1[] = "123";
does NOT equal the same thing as
char t[] = "test", t1[] = "123"; // in this case, I seem to get some 'conglomeration of t and t1 depending on the length of each.

I didn't THINK I had problems with such things as
int j, k;
but I could be wrong.
It might just be related to the initializers.
OR - I could be off my rocker (even further than I think <g>).
Steve

Re: Code folding error not entirely correct & initialize

Posted: 21 Nov 2008 08:25
by rajkovic
sadavis80 wrote: I also find that you cannot (apparently) combine multiple declarations on the same line - at least if you are initializing. i.e.
char t[] = "test";
char t1[] = "123";
does NOT equal the same thing as
char t[] = "test", t1[] = "123"; // in this case, I seem to get some 'conglomeration of t and t1 depending on the length of each.
we could not reproduce this behaviour. Everything worked as expected.
Could you please put whole code that is causing trouble, so we can compile it and see if there is an error.

Posted: 23 Nov 2008 01:50
by sadavis80
I think the problem I indicated was incorrect. I later 'discovered' that I had inadvertently created "strings" with no Zero terminator - so that when I looked at them in the Watch window, they ended up jumbled - since they weren't properly terminated. I have spanked myself with a long ruler so that should not happen again :).

On the same subject line... EVERY time I hit 'Compile' (Ctrl F9), my FOLDED code *UN* folds itself. I can live with this, but it seems it would be better to leave folded code folded. I FOLD code when I'm confident that it is working properly so I can focus on code that is "in writing" or 'not quite yet ready for public display' :).
Steve

Posted: 24 Nov 2008 10:25
by zristic
sadavis80 wrote:On the same subject line... EVERY time I hit 'Compile' (Ctrl F9), my FOLDED code *UN* folds itself. I can live with this, but it seems it would be better to leave folded code folded. I FOLD code when I'm confident that it is working properly so I can focus on code that is "in writing" or 'not quite yet ready for public display' :).
Steve
Hi Steve, I wish I could reproduce this. Is it easy to reproduce it on your side?

Posted: 24 Nov 2008 15:21
by sadavis80
Hmmm... Well it WAS. Now it's not. I'll watch more closely next time it happens and see if I can figure out what I was doing. I am pretty sure that I had made a CHANGE in code - away from the 'fold' when it happened (several times).
I'll try for a 'small code' duplication :).
Steve

Posted: 24 Nov 2008 16:40
by sadavis80
I think I figured it out. It wasn't Ctrl-F9, it was F9 (run debugger). When the debugger starts, it unfolds any folded code lines (understandable) - when I return to the editor, the code stays unfolded.

I was going to suggest that you include 'folding info' in the ini files, so that it would be restored after a project CLOSE and OPEN. - that should work for this situation as well.
Steve

Posted: 02 Dec 2008 16:13
by sadavis80
zristic wrote:
sadavis80 wrote:On the same subject line... EVERY time I hit 'Compile' (Ctrl F9), my FOLDED code *UN* folds itself. I can live with this, but it seems it would be better to leave folded code folded. I FOLD code when I'm confident that it is working properly so I can focus on code that is "in writing" or 'not quite yet ready for public display' :).
Steve
Hi Steve, I wish I could reproduce this. Is it easy to reproduce it on your side?
I think I got it - on the release version (probably beta too).
If you have ERRORS in your code and you compile, then all folded code is UNfolded automatically - no matter where the error is.

I just have too many errors :).
Steve

code folding follow up - also present in 1.3.5

Posted: 30 Dec 2008 14:21
by sadavis80
Take any 'c' file (I guess -- at least it works with mine).

'Code fold' at least 3 procedures (maybe less or more as well).

go ANYWHERE in unfolded code, place cursor at beginning of any line and hit 'ENTER', as it to add a line of code.

BANG!! you're dead. mC is GONE! First version just disappeared with no error messages. New 1.3.5 shows a 'Send bug report?' box and THEN disappears.

This happned to me several times before I figured out what was causing it. Now verified several times as well...
Steve