|
|
|
Joined: Jan 2004
Posts: 2,081
Hoopy frood
|
OP
Hoopy frood
Joined: Jan 2004
Posts: 2,081 |
//echo -a $version $read(no_such_file.txt,nt,1)
mIRC 6.xx, and most-if-not-all prior mIRC versions, evaluates the $read to null string.
mIRC 7.1 errors out with:
* $read: error opening C:\path\no_such_file.txt
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Why is that a bug? An actual error message is a good thing, isn't it?
|
|
|
|
Joined: Jan 2004
Posts: 2,081
Hoopy frood
|
OP
Hoopy frood
Joined: Jan 2004
Posts: 2,081 |
Why is that a bug? An actual error message is a good thing, isn't it? Well, not when it's a complete change in behaviour, where instead of returning $null and continuing the script as it's always done, it aborts the script.
|
|
|
|
Joined: Sep 2005
Posts: 2,630
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,630 |
This is a good thing.. not checking a file exists before attempting to read from it is incredibly lazy.
I don't think I've ever written a script that $reads before checking $isfile
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Just because something changes doesn't make it bad. As hixxy said, all scripts should really check if the file exists before trying to read from it anyhow unless you are absolutely certain it will be there. And, even then, it's a GOOD thing to know that it failed and why it failed rather than have it ignore the fact that part of the script isn't working forcing you to spend a long time trying to find the cause.
|
|
|
|
GSi
|
GSi
|
So, a LOT of scripts don't works now with this version.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
That is true with many updates to mIRC. And it's not limited to seeing a real error message instead of nothing. In fact, that change to $read to allow a real error message probably won't actually break very many scripts because most scripts are going to have been designed to not make use of having no error when the file doesn't exist. Other changes will affect many more scripts than that minor change.
This update is a huge update in order to make it support unicode. Khaled always works hard to keep mIRC as compatible with existing scripts as possible, but that's not always possible. Most scripts are going to need to be updated to work properly. Keep in mind that the public beta has been going on for a month or two prior to release and anyone who wanted to try and get their scripts updated before release had every opportunity to test the scripts and find the problems before release.
For example, I maintain the Invision script, which is a very large script. I had to make a LOT of changes to make it compatible with the new mIRC. I did so and we released it the same day as mIRC released. We had time to make the changes and test them and have it prepared for the new mIRC once it was released even though it's a very large script that required many changes. For scripts that are no longer being updated by the authors, anyone using them could have sought help in getting them updated during the beta period and still can ask for help now if they need it.
In the end, Khaled is not responsible for making mIRC work with scripts. The script authors are responsible for making their scripts with with mIRC. Like I said, Khaled does a great job in making it so that scripts usually don't break, but this new version had thousands of lines of code changes and you simply can't expect perfect compatibility with such a huge update.
|
|
|
|
Joined: Jul 2006
Posts: 4,020
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,020 |
The problem is that there's nothing in the changelogs that's talking about that change and it's totally acceptable for people to report a change in a behavior that isn't noted in the changelogs.
It's a good thing this has been reported whatever if the change is a good one or not
Last edited by Wims; 01/08/10 01:34 AM.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Dec 2002
Posts: 120
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 120 |
This is a good thing.. not checking a file exists before attempting to read from it is incredibly lazy.
I don't think I've ever written a script that $reads before checking $isfile Agree
|
|
|
|
Joined: Dec 2002
Posts: 3,841
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,841 |
Thanks, it looks like $read() is being more strict in the new version. I think it makes more sense, since you can debug your scripts more easily, however I did not expect it to be such an issue. Since backwards compatibility is important, I will change the behavior back to the old method in the next release.
|
|
|
|
|
|
|
|