Block Comment - Odd Behavior

Report problems with documented functionality
User avatar
the1corrupted
Posts: 36
Joined: 25 Jan 2014, 23:01

Block Comment - Odd Behavior

29 Jan 2014, 08:49

It may just be me on this, but I've had compile fails when I block-comment out something with the squiggly brackets ({})

For example:

Code: Select all

/*if (this) {
	this.that()
} */
But if I move the end-comment to the following line, it compiles fine. I will sometimes get "No functions within functions" error message when I reload the script. I'm not sure if it's just how AHK parses each line, but I know other scripting langages where this behavior isn't present.

Not a real major game-changing/killing "bug".

Code: Select all

/*if (this) {
	this.that()
} 
*/
Automating work is twice as much fun
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Block Comment - Odd Behavior

29 Jan 2014, 08:51

[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
timeFlies
Posts: 146
Joined: 22 Oct 2013, 20:54
Location: Somewhere in the northern hemisphere.

Re: Block Comment - Odd Behavior

29 Jan 2014, 12:47

The */ has to be at the start of the line.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Block Comment - Odd Behavior

31 Jan 2014, 03:44

@chaz... you mean Startline: /* & Endline: */

Code: Select all

; This entire line is a comment.

Run Notepad  ; This is a comment on the same line as a command.

/*
MsgBox, This line is commented out (disabled).
MsgBox, This one too. 
*/
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
lexikos
Posts: 9679
Joined: 30 Sep 2013, 04:07
Contact:

Re: Block Comment - Odd Behavior

01 Feb 2014, 02:15

No, I believe chaz meant what he said, and was perfectly accurate. */ ends a comment, not a line. You can even put things after */, but not before it.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 9 guests