mIRC Home    About    Download    Register    News    Help

Print Thread
Locating Error? #76622 25/03/04 10:18 AM
Joined: Apr 2003
Posts: 210
S
saxon Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Apr 2003
Posts: 210
Hi, I load up an old script today. It's very big, Well over a thousand lines.

mIRC spits out this error in the status window:
* /if: invalid format

Err.. Ok. No line number or script file, That isn't unusual for a mIRC error message. crazy

But the question is, How do i use the new 6.14 error handling to locate this error? Or is it a case of just deleting my old script, Which took avery long time to make. And no, I don't intend to waste my life going throught the file manually :-)

You may of heard the expression "Needle in a hay stack".

Re: Locating Error? #76623 25/03/04 10:59 AM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
a good way to narrow it down would be to search all lines that match * timer* if *

because the only time mIRC wont give a filename and line number is when there isnt one .. like if you type the command into the commandline manualy .. or if its executed by a timer

Cobra^

Re: Locating Error? #76624 25/03/04 12:11 PM
Joined: Apr 2003
Posts: 210
S
saxon Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Apr 2003
Posts: 210
Quote:
because the only time mIRC wont give a filename and line number is when there isnt one .. like if you type the command into the commandline manualy .. or if its executed by a timer


If only that were true crazy

Here's 2 examples off the top of my head where it applies directly to events:

on *:text:*:*:{
ThisIsAnunkownCommand
}

on *:text:*:*:{
echo -a $iif(ischan $target,Yes,No)
}


This first one Unkown command is particularly nasty because it could result from a %variable being evaluated or another reason. Meaning that you simply can't search the file for "ThisIsAnunkownCommand".

There are ones i just thought of, After scripting solidly for a few years im sure there are other situations too.

There is also silly mistakes like this:
on *:TEXT:*:*:*:{
echo -a blah
}
on *:Input:*:*:{
echo -a blah
}

Although those last 2 are silly mistakes and easier to locate it is another example of the parser not reporting script or line number when it knows it full well.

Btw I searched for problems with /timers and the problem doesn't lay there. I take it the new error handling can't track these kind of errors?


Re: Locating Error? #76625 25/03/04 01:26 PM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
the unknown command problem is not an error in mIRC

if a command isnt an internal alias to mIRC, and isnt a scripted alias inside mIRC, then the 'command' is sent to the server .. so in that case there is no error in mIRC .. however there may be an error in your code but mIRC has no way of knowing that, the error you see is sent from the server, and not mIRC

however good point about $iif() .. i hadnt thought of that

if your sure there is no problem with timers .. then the problem probably lies in $iif()

to use mIRC's error handling feature you would have to know which event or alias the error occured in, and even then all it does is alow you to triger the execution of code when the error occures ..

Cobra^

Re: Locating Error? #76626 25/03/04 04:27 PM
Joined: Dec 2002
Posts: 102
M
MIMP Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 102
You could if you like go through and add error code to each event/alias that you think may be the source of the error. Example:

alias test {
<commands>
}

alias test {
<commands>
:error
echo -s Error: $error $scriptline
}

By using $scriptline you can figure out which line is actually echoing the error code. From there at least you can narrow it down to one routine. Good luck.


-
MIMP