mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
1) If you tring to play a file that is not supported by mIRC (a .mpg or a .txt for exemple), mIRC said that the file doesn't exists :
Quote:
* /splay: no such file 'Path\file.ext'

You can reproduce this by typping something like :
Quote:
//splay $qt($file .)

Maybe mIRC can display that he can't open the file

2) Exemple is better that my bad explanation :] :

Quote:
//var %a 1 | while (%a <= 5 { inc -s %a } | echo -a end
This return * /while invalid format (as it should) but :

Quote:
//var %a 1 | while %a <= 5) { inc -s %a } | echo -a end
This WORKS !

Quote:
//var %a 1 | while %a <= 12) { inc -s %a } | echo -a end
This increase %a to 2 and break the while

Quote:
//var %a 1 | while %a <= 20) { inc -s %a } | echo -a end
This increase %a to 3 and break the while

Quote:
//var %a 1 | while %a <= 9) { inc -s %a } | echo -a end
This increase %a to 90 and break the while

Quote:
//var %a 1 | while (%a <= 9 { inc -s %a } | echo -a end
This return * /while invalid format



Edit : tested on 6.3 and 6.21

Last edited by Wims; 01/09/07 11:07 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
about the while loop problem, i'm not sure you can really call it a bug. it's how i'd expect it to behave :P for example:

Code:
while %a <= 12)


the second operand in that condition is the string "12)". there's no opening ( so that closing parenthesis is treated as plaintext

now when you use <= with non-numbers, it no longer performs a numeric comparison, but rather a comparison based on the order of the ASCII values of the two operands. 2 is seen as greater than 12) because the ASCII value of 2 is greater than the ASCII value of the first character of 12)

the same thing occurs with the rest of your examples. should this be considered a bug? i don't think so :P a similar situation arises with evaluation brackets, if you have no opening evaluation bracket, a closing one is plaintext:

Code:
//echo -a hi! ] ] ]



"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
agreed with jaytea. you're thinking of the brackets in the context of your own code-- for mIRC to actually understand that "while %x < 1)" was a syntax error it would require mIRC to also know that you meant "1" and not "1)"-- and since mIRC does not expect strings inside quotes, there is no way of knowing. this is why it will only parse )'s if the condition began with a (. this is by design, and very much expected, or someone else would come here complaining, saying:

"
hey guys, while is acting weird!

while %prefix isin a. a: a) { echo -a hi }
"

Stick to the proper syntax rules defined by mIRC (dot your i's, cross your t's, and read http://kthx.net/ftb/#34 ) and you will be fine. Playing on the edge cases of the interpreter will likely lead you into trouble.

... as for the splay thing, I agree that mIRC should mention it cannot read the file, not pretend it does not exist.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Hum, you're right.
I always forgot that non-numeric values can be used in most of the cases with mirc frown


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,421
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,421
Thanks the /splay issue has been fixed for the next version.

Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Hum on mIRC 6.31, the /splay command doesn't give an error message when the file isn't supported by mIRC, since there was an error message in previous version about this behavior, you've seen this and *fixed it* but it would be nice to have the error message, it's better to one than nothing smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,421
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,421
If I try to use /splay to play a file that mIRC cannot play, eg. readme.txt, mIRC reports * /splay: unable to play 'readme.txt'. Are you not seeing that message?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

The error is seen here in 6.31 if sounds are enabled in the options dialog, otherwise nothing .. as expected.

Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
sorry about that smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard