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.
2 Ide Features
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
>> 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.
>
> 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.
I usually disable functions if needed with a Macro: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.
Code: Select all
Procedure a(b)
; do something
PrintN(Str(b))
EndProcedure
Macro a(b) : EndMacro ; Disable Function a()
"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!
"
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!

- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
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
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.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.
Code: Select all
Procedure P1()
..
..
EndProcedure
Code: Select all
Procedure P1()
EndProcedure
Procedure oP1()
..
..
EndProcedure