mIRC Home    About    Download    Register    News    Help

Print Thread
/if: invalid format error missing file/line info #214185 22/07/09 06:25 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline OP
Hoopy frood
OP Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
When an invalid if structure is placed on the same line as an event declaration, the "invalid format" error message will omit the file/line information vital to debugging. This only happens when the if statement is placed on the same line as the declaration.

Steps to reproduce:

1. Place the following code in a remote script:
Code:
on *:TEXT:*:?:if x x

2. Type //msg $me hi

This will display: "* /if: invalid format" without line information.

3. Change this to:
Code:
on *:TEXT:*:?: {
  if x x
}

4. Repeat //msg $me hi

This will properly display the file and line number:

* /if: invalid format (line 30, script.mrc)

Also happens with raw events and I assume this is the same for ctcp.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: /if: invalid format error missing file/line in [Re: argv0] #214534 07/08/09 07:53 AM
Joined: Jan 2004
Posts: 162
R
RRX Offline
Vogon poet
Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
Similar non-event case, related to /scid
Code:
alias ho { 
  scid 1 echo -s 
}

-> * /echo: insufficient parameters
Code:
alias ho { 
  echo -s 
}

-> * /echo: insufficient parameters (line 98, remote.ini)


And another case, affected by $iif()
Code:
alias mo { echo -s $iif($did(a,0).state,1,0) }

-> * Invalid parameters: $did

Code:
alias mo { echo -s $did(a,0).state }

-> * Invalid parameters: $did (line 98, remote.ini)




Last edited by RRX; 07/08/09 11:45 AM.