AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Comment block bug

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Akize



Joined: 16 Jan 2006
Posts: 32

PostPosted: Fri Jun 27, 2008 7:34 pm    Post subject: Comment block bug Reply with quote

I ran into this awhile ago and forgot to ever mention it. Did a quick forum search but didn't find anything either.

If you comment out your code like so:
Code:

f1::
msgbox f1
return

/*f2::
msgbox f2
return*/

f3::
msgbox f3
return


Autohotkey will load the script, but f3 will never be triggered. No errors will every be thrown.

Fixing it is simply moving the end comment onto its own line.

Code:

f1::
msgbox f1
return

/*f2::
msgbox f2
return
*/

f3::
msgbox f3
return
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 442

PostPosted: Fri Jun 27, 2008 7:37 pm    Post subject: Reply with quote

Comments in Scripts wrote:
the /* and */ symbols can be used to comment out an entire section, but only if the symbols appear at the beginning of a line
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Sat Jun 28, 2008 4:33 am    Post subject: Reply with quote

i have noticed this as well. when testing scripts for people in the forum, I often put an unclosed /* at the end of the script and ust test after that point in the same file.

It may be nice for AHK to detect an "unclosed" /*, but the documentation is still correct in this case.

Question for you C/C++, etc coders out there: If you end a file wit an unclosed /*, is there any warning or error? I suspect it's not even possible, sice all the code needs a } anyway.
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Akize



Joined: 16 Jan 2006
Posts: 32

PostPosted: Mon Jun 30, 2008 2:57 pm    Post subject: Reply with quote

Oberon wrote:
Comments in Scripts wrote:
the /* and */ symbols can be used to comment out an entire section, but only if the symbols appear at the beginning of a line


My bad, still don't understand why AHK can't at least throw an error when it occurs though.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group