comment several lines of code

Previous topic - Next topic

msx

Is there a way to comment several lines of  code using / * xxxx  * / as in C language? If that can be added for me would be helpful.

MrTAToad

At the moment, the only way is either manually adding // or highlighting a block and selecting Edit -> Toggle Block Comment

Hemlos

This is how you can fix an entire document:

On the menu bar at top of the IDE:
click "edit", and "select all", then click edit once more and click "replace"

A window will open for replacing words...
In the top edit box, type "/*"
In the bottom edit, type "//"
And finally click the button that says "Replace".

Your entire document will have all the "/*" entries replaced with "//"


Bing ChatGpt is pretty smart :O

Ian Price

Or you can highlight your block of text and use CTR+K. This acts as a toggle too.
I came. I saw. I played.

msx

Quote from: Ian Price on 2011-Jan-31
Or you can highlight your block of text and use CTR+K. This acts as a toggle too.

Perfect!  :nw:

Jonás Perusquía

Quote from: msx on 2011-Jan-31
Quote from: Ian Price on 2011-Jan-31
Or you can highlight your block of text and use CTR+K. This acts as a toggle too.

Perfect!  :nw:
Perfect!  :nw:
<HTML><BASIC><EC>
Be free and do good things

spicypixel

Quote from: Ian Price on 2011-Jan-31
Or you can highlight your block of text and use CTR+K. This acts as a toggle too.

Just make sure the top line that you comment out in the block isn't already commented out otherwise it screws up.
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.

sf-in-sf

There is also this useful way: use the pre-processor.

?IFDEF TESTING_CONDITION // or silly name
  //Plenty of dodgy code
  // that you don't want.
?ENDIF

To enable the code, write at the very top:
?DEFINE TESTING_CONDITION

Like this it's easy to switch from old to new version of a snippet, and vice-versa:

?IFDEF NEWVERSION
   //new code here.
?ELSE
   //old code here
?ENDIF
On the day the atom is a cube I will start believing in the square pixel.

mentalthink

CTRL+K I think it's better then /* and */ in C++ this it's really quick select a lof of lines and press the command...


r0ber7

Quote from: spicypixel on 2013-Mar-29
Just make sure the top line that you comment out in the block isn't already commented out otherwise it screws up.

Ah, so that's it. That has been annoying me. I still think adding /**/ would be a good idea though, for those of us working without the GLBasic IDE sometimes.

Schranz0r

/* blablabla */


i like the idea!
Pls post a request!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

I do
?IF 0
...
?ENDIF


Sent from my GT-N7100 using Tapatalk


spicypixel

/*



*/

Is perfect for the PHP guys amongst us :D +1 for meee.

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.

Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard