Code Folding Bug?
Moderators: Dorian (MJT support), JRL
-
- Macro Veteran
- Posts: 247
- Joined: Fri Apr 15, 2005 8:32 am
Code Folding Bug?
Code folding doesn't seem to work right when there's a dialog with a label object, all contained in a SRT. The folding seems to stop where the label object "end" tag occurs. Maybe it's working as intended.
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Code Folding Bug?
Probably just stretching the limits of the parsing. While we could spend time on that it is not really advisable to put a dialog inside a subroutine. Subroutines imply something that is reused, whereas dialogs should only be created once.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Macro Veteran
- Posts: 247
- Joined: Fri Apr 15, 2005 8:32 am
Re: Code Folding Bug?
Understood. Perhaps something could be added to the help file(s).
Another bug?
When I fold my SRT, save, close and re-open the macro, the SRT is magically unfolded which makes navigating more difficult. Interestingly, the commented block of code (/* ... */) doesn't automatically unfold--only the SRT.
MS 14.1.04
Another bug?
When I fold my SRT, save, close and re-open the macro, the SRT is magically unfolded which makes navigating more difficult. Interestingly, the commented block of code (/* ... */) doesn't automatically unfold--only the SRT.
MS 14.1.04
-
- Macro Veteran
- Posts: 247
- Joined: Fri Apr 15, 2005 8:32 am
Re: Code Folding Bug?
This issue (the unfolding upon re-opening a macro) has existed for me in the last several versions of MS. Fixing it would make navigation significantly easier.
Also, large comments blocks (/* ... */) are also magically unfolding upon re-opening the macro.
Thanks!
Also, large comments blocks (/* ... */) are also magically unfolding upon re-opening the macro.
Thanks!
-
- Macro Veteran
- Posts: 247
- Joined: Fri Apr 15, 2005 8:32 am
Re: Code Folding Bug?
After years of consternation, I finally managed to reproduce the Folding Bug.
Create a new macro.
Paste these 6 lines of code below into it.
Fold All.
Close and save.
Upon re-opening, the top line will be distorted but can be fixed with another Fold All.
Using /* and */ within an If statement seems to break the folding feature.
What makes it really troublesome is that each use of /* */ inside an IF> statement delays the ability to open the topmost line (by clicking the "+" to the left) by one. So in the code below, you'd have to click the plus twice more than once (3x total) to open the first line of commented text, i.e. with /* ... */.
So after a few hundred lines of highly documented code, one must click the topmost line dozens of times to see the commented text, or Unfold All--which then requires a Fold All if you want to reduce the clutter later.
There are other spinoffs of this bug that I've noticed repeatedly over the years including 1) not being able to open some folded code (e.g. IF> statements) unless the topmost commented block is finally opened by clicking dozens of times, and 2) the cursor will appear to be on one line but actually edit code on a line above or below.
Navigation would be easier if MS would fix this bug, or at least have a KB shortcut for Fold/Unfold All. Thanks for your consideration.
Create a new macro.
Paste these 6 lines of code below into it.
Fold All.
Close and save.
Upon re-opening, the top line will be distorted but can be fixed with another Fold All.
Code: Select all
/*
*/
If>a=b
/*
*/
EndIf
What makes it really troublesome is that each use of /* */ inside an IF> statement delays the ability to open the topmost line (by clicking the "+" to the left) by one. So in the code below, you'd have to click the plus twice more than once (3x total) to open the first line of commented text, i.e. with /* ... */.
Code: Select all
/*
*/
If>a=b
/*
*/
/*
*/
EndIf
There are other spinoffs of this bug that I've noticed repeatedly over the years including 1) not being able to open some folded code (e.g. IF> statements) unless the topmost commented block is finally opened by clicking dozens of times, and 2) the cursor will appear to be on one line but actually edit code on a line above or below.
Navigation would be easier if MS would fix this bug, or at least have a KB shortcut for Fold/Unfold All. Thanks for your consideration.