mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 19
V
vithos Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Sep 2003
Posts: 19
I have found several bugs with the implimentation of ANSI C style /* comments */ in mIRC v6.16. The following code will show examples:

Code:
alias testA { /* commentA
  echo -a testA 
  */
}

alias testB { echo -a testB }

/* commentB */
alias testC { echo -a testC }


executing /testA yeilds:

Code:
testA
* /*/: not connected to server (line 3, comments-bugs.mrc)


here, the "/* comment" is not evaluated, but the closing comment "*/" (although on a new line, as is usually required for these comments to work) is evaluated as a command

executing /testB yeilds:

Code:
testB


this is just to show that testA will not affect testC

executing /testC yeilds:

Code:
* /testc: not connected to server


this obviously should have echoed "testC", but all code after commentB is treated as a comment

also note that the capitalization of /testC differs from the input command and error message

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
v6.1 versions.txt:
Code:
84.Can now use /* and */ to comment out multiple lines in an alias,
   popup, or script. [color:red]Each be used alone on a single line.[/color]


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Sep 2003
Posts: 19
V
vithos Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Sep 2003
Posts: 19
That is quite disappointing. If they are not to be implimented correctly, then that should at least be mentioned in the mirc.hlp file, but why not just do them right? I can't imagine it being very difficult, but then again mIRC isn't open source, so who knows how the script interpreter works. At least make the comments break consistently?

Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
I guess the definition of "correctly" is up to Khaled, not some other programming language...

Joined: Sep 2003
Posts: 19
V
vithos Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Sep 2003
Posts: 19
I agree... to an extent. But I also subscribe to the Rule of Least Surprise when it comes to programming.


"The flip side of the Rule of Least Surprise is to avoid making things superficially similar but really a little bit different. This is extremely treacherous because the seeming familiarity raises false expectations. It's often better to make things distinctly different than to make them almost the same."

-- Henry Spencer

Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Yes, you're right. It's not that I disagree with you - I'd also like a more C-style behaviour of comments.

Joined: Jul 2003
Posts: 742
Hoopy frood
Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
vb style comments are nice too smile

Code:
  [color:green]'this code will close your app.[/color] 
  Function blah()
    [color:green]'close the program[/color] 
    End  [color:green]'close the program[/color] 
  End Function


http://MTec89Net.com
irc.freenode.net #MTec89Net
Joined: Sep 2003
Posts: 19
V
vithos Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Sep 2003
Posts: 19
I agree, but in order to have code followed by a comment on the same line, you would have to use a character escape for whatever character the comments get started with, which could get ugly. The solution of course is to quote strings, which I would love to see, but don't expect. I don't think requiring strings to be quoted and escaped would be very newbie friendly, which seems to be one of the main goals of mIRC script.

Joined: Jul 2003
Posts: 742
Hoopy frood
Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
vb doesnt need an escape charecter..


http://MTec89Net.com
irc.freenode.net #MTec89Net

Link Copied to Clipboard