mIRC Home    About    Download    Register    News    Help

Topic Options
#264719 - 06/01/19 04:44 AM $hfind/$findfile/... not giving line # on error
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3495
Loc: France
When an error is generated from the command parameter of these ($finddir not tested but most likely included), the line number and script file for the error is not provided:

$hfind(1,*,0,w,if () ) or $findfile(.,*,0,if ($inrect(1,2,3)) noop )

_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#264720 - 06/01/19 01:27 PM Re: $hfind/$findfile/... not giving line # on error [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4420
Loc: London, UK
Thanks for your bug report. I have not been able to reproduce this issue yet. If I place your $findfile() example in an alias in a script and call the alias from the editbox, it reports an error with the script name and line number.

Top
#264721 - 06/01/19 05:22 PM Re: $hfind/$findfile/... not giving line # on error [Re: Khaled]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3495
Loc: France
It may be related to my usage of bracket, I thought any kind of script error would do it.


The functionnal line of code:
Code:
noop $hfind(rr,i*,0,w,if ($inrect($mouse.x,$mouse.y, [[ $hget(rr,$1) ]] )) noop)


What triggers the issue (invalid parameters: $inrect) is:
Code:
noop $hfind(rr,i*,0,w,if ($inrect($mouse.x,$mouse.y,[ $hget(rr,$1) ])) noop)

So:
Code:
alias testerror {
  hadd -m rr i1 0 , 0 , 0 , 0
  noop $hfind(rr,i*,0,w,if ($inrect(0,0,[ $hget(rr,$1) ])) noop)
  :error
  hfree rr
  if ($error) {
   reseterror
   echo 4 -s from /testerror:  $v1
  }
}
This reproduce the issue for me, I'm on 7.53 and not 7.54 for some reasons.


Edited by Wims (06/01/19 08:11 PM)
Edit Reason: tested on 7.54.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#264724 - 07/01/19 02:13 AM Re: $hfind/$findfile/... not giving line # on error [Re: Wims]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1141
It's happening in 7.54 also. It happens for $hfind but I can't make it happen for $findfile or $finddir. When this glitch happens, it's falling through to the next line with $error defined without mentioning a line number, instead of jumping to the :error label.

Code:
alias testerror {
  echo 5 -a beginning value of $ $+ error is: $error
  ; echo -a $null 
  ; noop  $findfile(.,*,0,1,if $false noop)
  ; noop  $finddir(.,*,0,1,if $false noop)
  noop     $hfind(rr,i*,0,w,if $false noop)
  echo 6 -a falling thru. this will not contain a line number: $error
  :error
  echo 3 -a entered :error at line $scriptline with $ $+ error set to: $error
  if ($error) {
    reseterror
    echo 4 -s from /testerror:  $v1
  }
}

Top
#264725 - 07/01/19 03:10 PM Re: $hfind/$findfile/... not giving line # on error [Re: maroon]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1141
Sorry. I still had the hashtable in memory from the prior alias, and shouldn't have taken the line

hadd -m rr i1 0 , 0 , 0 , 0

... out of the alias. One you add this line to the beginning of my version of the alias, the error without the line number happens again. The trigger was an error within the $hfind command, not with $inrect specifically.

Top
#264793 - 12/01/19 11:17 AM Re: $hfind/$findfile/... not giving line # on error [Re: maroon]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3495
Loc: France
I mistested using the editbox for $findfile, that's why it didn't have line numbers etc. But you found a different issue here, it should not call the '/echo 6 -a' line after the error. Though, this may be the same issue internally.

Khaled: Can you reproduce?
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#264817 - 14/01/19 09:59 AM Re: $hfind/$findfile/... not giving line # on error [Re: maroon]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4420
Loc: London, UK
Thanks, I was able to reproduce this issue. In this case, $hfind() was coded so that it would not halt a script if there was an error in the alias call. I cannot see how this would be useful, so I am going to assume it is a bug. This has been fixed for the next version.

Top