locked
Small Basic Prime Commenting out lines Single quote moves back to first column in regular Small Basic RRS feed

  • Question

  • If you need to comment out a group of code lines in regular Small Basic you will find that after inserting a single quote in the first line then hitting the down arrow that the cursor moves back to the first column and moves to the next line. When you do this with Small Basic Prime you will see that the cursor moves to column 2. So, then you have to hit the left arrow key to get it back to column 1. It would be better if Small Basic Prime worked the way that regular Small Basic works. Anything to make it easier and for a similar operation to be consistent!

    JR

    Thursday, June 4, 2020 1:35 AM
    Answerer

Answers

  • yes you are right ! I had to load the old basic to realize why sometimes it was so misleading. It will also be a good idea when after pointing the - sign to contract a bloc of code hitting the ' (on the first line) the whole bloc will be commented or uncommented. 

    Sometimes I am using a begin1:  command and a goto begin1 command, or simply an if  "false" then   

    and an  endif   to jump to the end of a bloc.  The problem is that at runtime syntax and construction errors will be detected. 

    But there is still another trick ... You can select  a bloc of code passing with the left key of the mouse on it. 

    Clicking on the right key will give as option to comment or uncomment all the lines.    But as always there are some limitations  the comments are not toggled and highlighting part of a line will comment or uncomment the whole line ! 

    There are also other options such as uncomment the file commands - commented with an import of a programfile.

    You can also hide (expand collapse) some code to make a screendump, but making the program unreadable ? Fortunately the collapsed text will also be saved ... etc 

    good luck ! 

     

    • Edited by Eddy Abts Thursday, June 4, 2020 7:36 AM
    • Marked as answer by jricestkEditor Thursday, June 4, 2020 12:27 PM
    Thursday, June 4, 2020 7:33 AM
  • Collapsing works on Subs or complete loops by clicking on the minus in a circle in front of the first statement. That first statement is then shown with a plus in front and the other statements of that sub/loop disappear..

    By clicking on the plus they reappear.


    Jan [ WhTurner ] The Netherlands

    Thursday, June 4, 2020 11:41 AM
    Answerer

All replies

  • yes you are right ! I had to load the old basic to realize why sometimes it was so misleading. It will also be a good idea when after pointing the - sign to contract a bloc of code hitting the ' (on the first line) the whole bloc will be commented or uncommented. 

    Sometimes I am using a begin1:  command and a goto begin1 command, or simply an if  "false" then   

    and an  endif   to jump to the end of a bloc.  The problem is that at runtime syntax and construction errors will be detected. 

    But there is still another trick ... You can select  a bloc of code passing with the left key of the mouse on it. 

    Clicking on the right key will give as option to comment or uncomment all the lines.    But as always there are some limitations  the comments are not toggled and highlighting part of a line will comment or uncomment the whole line ! 

    There are also other options such as uncomment the file commands - commented with an import of a programfile.

    You can also hide (expand collapse) some code to make a screendump, but making the program unreadable ? Fortunately the collapsed text will also be saved ... etc 

    good luck ! 

     

    • Edited by Eddy Abts Thursday, June 4, 2020 7:36 AM
    • Marked as answer by jricestkEditor Thursday, June 4, 2020 12:27 PM
    Thursday, June 4, 2020 7:33 AM
  • Eddy,

    Good point on the select a group of lines and then adding a single quote. Doing the same for a group of lines that haves been commented that you want to uncomment. i guess I'm forever stuck on doing it the way I used to. Didn't even think of using that.

    Your last comment on expanding or collapsing. How do you get that to work? If I select a group of lines and try to collapse them it doesn't do anything.


    JR

    Thursday, June 4, 2020 11:34 AM
    Answerer
  • Collapsing works on Subs or complete loops by clicking on the minus in a circle in front of the first statement. That first statement is then shown with a plus in front and the other statements of that sub/loop disappear..

    By clicking on the plus they reappear.


    Jan [ WhTurner ] The Netherlands

    Thursday, June 4, 2020 11:41 AM
    Answerer
  • WhTurner33,

    Got it. I was thinking that you just selected a group of lines and hit collapse. Doesn't work the way I thought

    Thanks,


    JR

    Thursday, June 4, 2020 12:26 PM
    Answerer
  • « Collaps Folding » … strange command ! I am only using it when the cursor is positioned somewhere in the Main program (or somewhere else) executing a rightclick and pointing “collaps Folding”. At that moment as it is the main program  there is no + or – because it is not a subroutine but … all the subroutines will be folded  (or unfolded). As normally the main program is a succession of subroutines and my  subroutines are standard and standalone (independent and as such not calling other subroutines) I can immediately control the programflow. So the rightclick collaps folding is working on the complete program and not only on one subroutine.   When I need to unfold a subroutine I am ckicking in the +- area. The +- is only working on the selected part (the part to next +-) is this correct Jan or are there other differences ?                                                                                                            PS: A short remark ... I was trying to printout a subroutine ... because on screen it is keeping the linenumbering. But the printer unfortunately is printing all the lines not taking in account the folding ! (wasting paper)   









    • Edited by Eddy Abts Thursday, June 4, 2020 1:33 PM
    Thursday, June 4, 2020 1:05 PM