| View previous topic :: View next topic |
| Author |
Message |
Akize
Joined: 16 Jan 2006 Posts: 34
|
Posted: Fri Jun 27, 2008 8:34 pm Post subject: Comment block bug |
|
|
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 |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Jun 27, 2008 8:37 pm Post subject: |
|
|
| 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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Sat Jun 28, 2008 5:33 am Post subject: |
|
|
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. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
Akize
Joined: 16 Jan 2006 Posts: 34
|
Posted: Mon Jun 30, 2008 3:57 pm Post subject: |
|
|
| 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 |
|
 |
|