mIRC Homepage
Posted By: BoredNL /if /if /if dang it! :( - 02/09/03 04:46 PM
* /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.
Posted By: SladeKraven Re: /if /if /if dang it! :( - 02/09/03 04:58 PM
I am using mIRC 6.03 and it does just that.
* /if: invalid format (line 2, script1.ini)
Code:
alias num {
  if ($1 == 1 { echo -a The number is one. }
  else { echo -a Unknown number. }
}

That's what I used to test it.
Posted By: saxon Re: /if /if /if dang it! :( - 02/09/03 05:05 PM
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.
Posted By: tontito Re: /if /if /if dang it! :( - 02/09/03 05:06 PM
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. }}
Posted By: SladeKraven Re: /if /if /if dang it! :( - 02/09/03 05:10 PM
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.
Posted By: pheonix Re: /if /if /if dang it! :( - 02/09/03 05:12 PM
Quote:
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. mad
Posted By: SladeKraven Re: /if /if /if dang it! :( - 02/09/03 05:15 PM
I wouldn't know, I have never used 6.01, only used this 6.03.
Posted By: tontito Re: /if /if /if dang it! :( - 02/09/03 05:20 PM
his text wasn't particulary clear to give that idea.
looked more like another guy with the same problem...
Posted By: SladeKraven Re: /if /if /if dang it! :( - 02/09/03 05:44 PM
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)


Code:
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.
Posted By: psycogod Re: /if /if /if dang it! :( - 02/09/03 06:09 PM
maybe its in a /timer
do u have
/timer if (conditions) { commands }
anywhere in ur code

i may be wrong
Posted By: Matteh Re: /if /if /if dang it! :( - 02/09/03 08:59 PM
*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:
Posted By: rbhibbs Re: /if /if /if dang it! :( - 02/09/03 10:05 PM
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().
Posted By: WatchMinister Re: /if /if /if dang it! :( - 03/09/03 12:56 AM
I might be wrong but I believe if errors in events do not show the line number..
Posted By: Raccoon Re: /if /if /if dang it! :( - 03/09/03 01:10 AM
Actually, single-line /if statements dont show a line number.

So focus on /if statements that dont span multiple lines.
Posted By: Iori Re: /if /if /if dang it! :( - 05/09/03 08:29 PM
Quote:
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.
Posted By: Raccoon Re: /if /if /if dang it! :( - 05/09/03 10:22 PM
Even better still. that should narrow it down considerably.
Posted By: Iori Re: /if /if /if dang it! :( - 05/09/03 10:36 PM
Yep, narrows it quite a bit really, it's still a bit of a task though with 45 script files. laugh
Posted By: landonsandor Re: /if /if /if dang it! :( - 05/09/03 10:45 PM
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
Posted By: Iori Re: /if /if /if dang it! :( - 05/09/03 10:53 PM
Not my work, I'm not the one with the problem, nor do I have anywhere like 45 script files loaded. grin
Posted By: landonsandor Re: /if /if /if dang it! :( - 06/09/03 06:24 PM
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 smile smile smile
Posted By: Raccoon Re: /if /if /if dang it! :( - 06/09/03 08:58 PM
If only our criminal justice system where so easy... and yummy! --Raccoon
Posted By: landonsandor Re: /if /if /if dang it! :( - 07/09/03 03:01 AM
amen to that rac
Posted By: BoredNL Re: /if /if /if dang it! :( - 12/12/03 04:24 AM
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..
Posted By: cold Re: /if /if /if dang it! :( - 16/12/03 05:54 PM
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.
© mIRC Discussion Forums