Am I missing REMark/comment blocks in GLBasic?
Eg
Rather then typing // for every line that I want a comment in - like this
// This is a comment/remark
// So is this
// And this
Other languages allow
/* This is a comment/remark
So is this
And this
*/
It makes commenting out whole functions etc a doddle.
Does GLB offer this already?
If you just select the whole function you want commented out you can press ctrl+K to comment out those lines.
or right click - Toggle Block Comment ....
That'll make functions easier, but it doesn't help for a block of comments that aren't in functions (I suppose I could make them functions, but that's excessive). I'd rather /* */ than do that.
Quote from: PeeJayor right click - Toggle Block Comment ....
http://www.glbasic.com/forum/viewtopic.php?id=1560
Just a reminder... from Feb. ;)
Yes but that's still not what I requested - my required text may not be in a function - besides "Toggle Block Comment" doesn't appear to be working...
If 1=0
comment here
EndIf
This is more like it, but still not as elegant or quick as /* */ and doesn't work for whole functions, just bits of code.
We need my example, so that we can do this to short (long) comments as well as whole functions/sections of code.
Works for me, and it is not restricted to only functions, you can do it to any line in your code, just make sure you select some lines first before pressing ctrl+K
Thankfully you don't have to type:
50 REM print this or that
60 REM if blah=bleh then exit sub
70 REM gosub 110
80 REM
Needless to say you got very fast at pressing arrow up and arrow left at the same time as R or E or M or something, for editing several lines at the same time. And then you where cursing because you forgot to press enter on one of the lines before typing "RUN" :-)
Bizzarro - Toggle block code is working now. Strange.
Cheers for the heads up and boy do i remember days of the REM statement and numbered code! :D
Case closed. Sorted. You can go about your business. Move along. Move along.
Quote from: Ian Price on 2008-Apr-01
That'll make functions easier, but it doesn't help for a block of comments that aren't in functions (I suppose I could make them functions, but that's excessive). I'd rather /* */ than do that.
Here is a way to get it:
inline
/*
here your out-commented code, many lines
...
and then
*/
endinline
Having /* and */ would be cool though :) Also a + - around functions and subs to fold the code :P
To remark a big block, just select the whole block and press Ctrl+K.
You already can fold functions and subs. just double click on that blue bar in front of a function.
This thread was created 4 and a half years ago! Talk about bring things up from the dead!
As for /* and */ I'd still prefer those to the CTRL+K (and Yes Kanonet - that was mentioned, but at the time wasn't working).
I prefer use the K key... than put /* and */... when I do something in Arduino, for me it's very confusing, sometimes I don't know where I started or where I finished the comment...
Perhaps this can be added, and using the both options...
Quote from: kanonet on 2012-Dec-12
To remark a big block, just select the whole block and press Ctrl+K.
You already can fold functions and subs. just double click on that blue bar in front of a function.
Aha my block is green but I have found it, thank you. I thought it was just to highlight the function itself. Would be nicer with a [-] to see that it can be folded though but glad it's there :)
One reason I want the /* */ delimiters is because in PHP I use them to do this...
/*
// start of huge code block
// end of huge code block
/* */
Using the above example I can amend the first delimiter "/*" to comment/uncomment a block of code (because my second /* is commented out too) without having to waste time highlighting large sections and then CTRL+K'ing it. This is why I want the /* */ delimiters :D
?IF 0
...
?ENDIF
;)