![]() |
closing block comments...or not?
Had a weird problem with the serverside portion of a class not working, but the clientside portion worked fine:
After 20 minutes of trying to figure out why the hell my code was freaking out, I found that the problem was commented out information about functions contained in the script: PHP Code:
PHP Code:
|
doesn't seem like a bug to me. just a bad use of comment codes. there's no reason why you should use the /* */ if you're just going to use // vice versa.
|
Anything after // will be comments, so you can't use */ after a // on the same line. Serverside is read separately from clientside, so if you did a /* at the top of a script, it would only comment out until it reaches //#CLIENTSIDE.
If you wanted to comment out a whole script you would have to put a /* at the top and a /* right under //#CLIENTSIDE. |
Quote:
The script window telling you that the block comment is closed, but the compiler seeing it otherwise is a bug. And the fact that it only knocked out the serverside portion of the code is even worse...had nothing worked, I could have easily determined that the code was commented out, but that wasn't the case. Quote:
If I placed /* at the top of a script, everything appears to be commented out in the script window (serverside AND clientside)...but I haven't tested if the clientside portion still works. I know that // comments out the entire line, but it doesn't change the fact that the block comment appeared to be closed but in fact wasn't |
Quote:
As a good rule of thumb I usually start a line like HTML Code:
/* |
Quote:
EDIT: I thought everything within a block comment was ignored when compiled (isn't that the purpose of comments??)...why would one line comments within the block comment not be ignored? |
Quote:
|
Quote:
|
Single-line comments can be used to comment out the end of multi-line comments, for GS1 compatibility. Most other languages don't allow that and the script highlighter is simplier in that regard so it's not supporting it.
The server should display a warning if multi-line comments are not closed, if it's not doing that yet then we can add it. |
| All times are GMT +2. The time now is 08:18 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.