Remark blocks

Previous topic - Next topic

Ian Price

Am I missing REMark/comment blocks in GLBasic?

Eg

Rather then typing // for every line that I want a comment in - like this
Code (glbasic) Select
// This is a comment/remark
// So is this
// And this
Other languages allow
Code (glbasic) Select
/* This is a comment/remark
   So is this
  And this
*/
It makes commenting out whole functions etc a doddle.

Does GLB offer this already?
I came. I saw. I played.

Moru

If you just select the whole function you want commented out you can press ctrl+K to comment out those lines.

PeeJay

or right click - Toggle Block Comment ....
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

Ian Price

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.
I came. I saw. I played.

bigsofty

Quote from: PeeJayor right click - Toggle Block Comment ....
http://www.glbasic.com/forum/viewtopic.php?id=1560

Just a reminder... from Feb. ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Ian Price

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...

Code (glbasic) Select
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.
I came. I saw. I played.

Moru

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:

Code (glbasic) Select
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" :-)

Ian Price

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.
I came. I saw. I played.

sf-in-sf

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:

Code (glbasic) Select

inline
/*
here your out-commented code, many lines
...
and then
*/
endinline
On the day the atom is a cube I will start believing in the square pixel.

spicypixel

Having /* and */ would be cool though :) Also a + - around functions and subs to fold the code :P
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

kanonet

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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Ian Price

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 came. I saw. I played.

mentalthink

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...

spicypixel

#13
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...
Code (glbasic) Select

/*
    // 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
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Kitty Hello

Code (glbasic) Select

?IF 0
...
?ENDIF


;)