* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
* /if: invalid format
get the idea? (that's just a small part of it. It doesn't happen immediately, 1 /if error pops up every now and then.)
it keeps saying "* /if: invalid format", but it doesn't say where it comes from. Having around 45 script files loaded, it's kind of tough figuring out where in the world that if statement is erroring..
Making the /if command always show what script and line it's erroring out at (if being called from a script) would be very nice.
I am using mIRC 6.03 and it does just that.
* /if: invalid format (line 2, script1.ini)
alias num {
if ($1 == 1 { echo -a The number is one. }
else { echo -a Unknown number. }
}
That's what I used to test it.
Well it gives the filename and line number in 6.1 too. Maybe under some circumstances it doesn't give it, but that would go for 6.03 also.
But yeah, it should be made to always give filename and line number, for all errors.
next time don't forget to close the if statment with )
try this one
alias num { if ($1 == 1) { echo -a The number is one. } else { echo -a Unknown number. }}
If you had read I said that is what I used to show that error, I did it intentionally, I do know how to use parenthesis.
That's what I used to test it.
he was testing it, he didnt need a fix, he knew it was invalid format, read posts thoroughly before replying please.
I wouldn't know, I have never used 6.01, only used this 6.03.
his text wasn't particulary clear to give that idea.
looked more like another guy with the same problem...
I am sorry, I gave you that impression, ironic how Phoenix knew what I meant.
Is this more clear, can you take it in now?
I
a m
u s i n g
m I R C 6 . 0 3
a n d
i t
d o e s
j u s t
t h a t
* /if: invalid format (line 2, script1.ini)
a l i a s n u m {
i f ( $ 1 == 1 { e c h o - a T h e n u m b e r i s o n e . }
e l s e { e c h o - a U n k n o w n n u m b e r . }
}
Now for the actual clue.
T h a t ' s
w h a t
I
u s e d
t o
t e s t
i t.
maybe its in a /timer
do u have
/timer if (conditions) { commands }
anywhere in ur code
i may be wrong
*throws in his advice*
i reckon its from an $iif thingy...
i had this problem a while ago, and i had to sit and wait for it to happen and then look @ a debug thingy to see what caused it...
tis a bit annoying and time consuming but it beats having all those errors :tongue:
Script errors (not popups) in version 6.03 generally will identify the source file and line number -- although I don't claim to have tested every single script command's behavior when I make an error.
the $iif() identifier, used in a popup such as nicklist, will generally show the uninformative error if there are any problems with the format of the $iif().
I might be wrong but I believe if errors in events do not show the line number..
Actually, single-line /if statements dont show a line number.
So focus on /if statements that dont span multiple lines.
Actually, single-line /if statements dont show a line number.
Actually it is single line events, single line aliases return the correct error message.
on *:open:?:bah: if ($1 = 1 { echo -s hello } << * /if: invalid format
alias bah if ($1 = 1 { echo -s hello } << * /if: invalid format (line N, file.mrc)
The same for $scriptline.
Even better still. that should narrow it down considerably.
Yep, narrows it quite a bit really, it's still a bit of a task though with 45 script files.
well, to cut down on the work you could try using a global find for something like : if ( and let MIRC do the looking. One line events seem to follow this pattern. if that doesn't work, try using :if (. Hope this helps cut down on your work
Not my work, I'm not the one with the problem, nor do I have anywhere like 45 script files loaded.
Crime: Replying to wrong person in thread
Punishment: Box of cookies
Implementation: Iori - have a box of animal cracker cookies as I obviously replied to the wrong person
If only our criminal justice system where so easy... and yummy! --Raccoon
hmm, I see this never got clarified very well..
ok then, to clarify.
If it is called from a timer, have it say
* /if: invalid format (timer <timer name goes here>)
The if error not showing what line and script it's on if it's all on one like should simply be fixed, as that is a bug.
And there you have it.
I'm still having the error.. Hunting for it has been tiresome.. grr..
I wouldn't call it a bug. /timer was already out of the original scope when the command was called. There was no relation anymore between /if and the line where /timer was called.
This is rather a feature suggestion.