2 Ide Features

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Logical because of knowing the internal working way, then yes, the behaviour is logical.
But not so logical for a programmers point of view, imho.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Why ?

Inside a Compilerif, everything is ignored. Including macros.
You need no internal knowledge to understand that.

Macros are also not expanded inside comments as well, and nobody would think that
to be illogical either.
quidquid Latine dictum sit altum videtur
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

freak wrote:Inside a Compilerif, everything is ignored. Including macros.
I see now. Sorry, Thanks.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

>> Which sucks to do when the block is more than a screen size long
>
> That would be a lot of comments

Yes. Sometimes I need to disable a procedure, and when the procedure is
several screen lines long (such as SendKeys), then it becomes a hassle to
select it all and then press CTRL+B.

Also, Freak's CompilerIf solution (which I also once posted) works, but none
of the "commented" code appears in the comment color, which isn't good.
It still looks like uncommented code if you scroll through your source.
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

PB wrote: Yes. Sometimes I need to disable a procedure, and when the procedure is
several screen lines long (such as SendKeys), then it becomes a hassle to
select it all and then press CTRL+B.
I usually disable functions if needed with a Macro:

Code: Select all

Procedure a(b)
  ; do something
  PrintN(Str(b))
EndProcedure

Macro a(b) : EndMacro ; Disable Function a()
Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

i make use of folding sequences (like with ";{-") quite a lot, so if i want to uncomment a (bigger) sequence, i just unfold it and can mark it easily on 3 lines.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

It's a neat trick but the syntax coloring and keyword recognition happen inside the block, making it too irritating to be a real solution. Turning that off for CompilerIf blocks would make a mess, so some actual comment block keywords would be a nice addition. (just noticed that PB made the same observation, so I agree with him)
BERESHEIT
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

PB wrote:Yes. Sometimes I need to disable a procedure, and when the procedure is
several screen lines long (such as SendKeys), then it becomes a hassle to
select it all and then press CTRL+B.
I just chuck in an extra character in the name of the procedure and put a new empty definition in front of the old one.

Code: Select all

Procedure P1()
..
..
EndProcedure
becomes

Code: Select all

Procedure P1()
EndProcedure

Procedure oP1()
..
..
EndProcedure
Not the most elegant way of doing things but it saves scrolling through screens of code to ctrl+b.
Post Reply