Bug? B4A v5.00 Block Commenting Works Differently ... ?

Discussion in 'Bugs & wishlist' started by Andris, Jun 8, 2015.

  1. Andris

    Andris Member Licensed User

    It seems to me that block commenting works differently in v5.00 (both release and BETA) than it did in previous versions. Previously, I'm sure that I was able to take an entire block of code, including existing comments, and with the block command, add another layer of comment apostrophes in the first character position of each line, keeping the existing comment structure intact. Now, when I block comment, it first takes out all the existing comment apostrophes, making all lines "code," instead of just adding apostrophes in the first column. In other words the new version acts on comment apostrophes that occur anywhere, whereas before I think it acted only on apostrophes that existed in the first column.

    I like the previous way it worked much better. The new way can easily lead to coding errors.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It toggles the comment state based on the state of the first line. If the first line is commented then all lines will be uncommented and vice versa.
     
  3. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I'm not sure if that is the best way to do it?

    Imagine you have a sub like this:
    Code:
    'This sub will create activity stuff
    Sub CreateActivityStuff
      
    'Generate Toolbar
      Toolbar.Generate
      
    'Generate Drawer
      Drawer.Generate
    End Sub
    Doing a block comment on this small sub:
    - If the first line selected is the comment line above the sub then:
    The first time all comments apostrophes will be removed and then it becomes an irreversible operation as all lines will either be comments or non-comments.​
    - If the first line selected is the Sub line then:
    It works pretty normally, i.e. it adds another apostrophe to the comment line essentially double commenting it, so it is a reversible operation​
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Everything is reversible as you can always undo the change.

    I understand the issue. However I think that we need to wait awhile to see whether this is a real issue or not. Personally I prefer the single shortcut option.
     
  5. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I agree. I also prefer the single shortcut option.
     
  6. klaus

    klaus Expert Licensed User

    I prefer the two button mode.
    We know exactly what it does, one does commenting and the other uncommenting.
    With the new mode we need to look first at the top lines of the block to change and choose the correct line to get the result we want.
     
    Derek Johnson likes this.
  7. Andris

    Andris Member Licensed User

    Ah I see. OK, I can live with that. I can't believe I didn't figure that out myself! Am I wrong that this is different than pre-5.0 though? (Actually, from the above discussion, I guess it was 2-button before ... and single now). I think I prefer 2-button as well - unless the toggling worked just on the first column, in which case 1 button would be fine.
     
  8. Informatix

    Informatix Expert Licensed User

    I vote for the old method. You didn't have to think about the result; it was intuitive and without surprise.
     
    vecino, jmon, Derek Johnson and 3 others like this.
  9. inakigarm

    inakigarm Well-Known Member Licensed User

    Old method too
     
  10. Troberg

    Troberg Well-Known Member Licensed User

    I agree, I prefer the old method as well.

    Even better, however, would be some kind of block comments, for example:

    <'This
    is
    all
    comments
    now'>
     
  11. sorex

    sorex Expert Licensed User

    but then it's a pain to uncomment 1 line inthere.
     
  12. Filippo

    Filippo Expert Licensed User

    The old method is better for me.
     
  13. kohle

    kohle Active Member Licensed User

    old method is better for me
     
  14. GGSoft

    GGSoft Member Licensed User

    I vote the old one.
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    As I wrote we should reevaluate this several weeks from now.
     
  16. Andris

    Andris Member Licensed User

    Agreed.
     
  17. Gunther

    Gunther Member Licensed User

    I vote the old one, too.
     
    Derek Johnson likes this.
  18. fixit30

    fixit30 Active Member Licensed User

  19. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I noticed this behaviour in the Beta but realised what was happening and thought it was by design. I soon got used to selecting a blank line above any existing comments when wanting to block comment sections out. But I admit that you do need to exercise far more care than was needed with the old system. Personally I too prefer the old way.
     
    Pendrush and klaus like this.
  20. Dey

    Dey Active Member Licensed User

    I vote the old one, too.
     
Loading...