mIRC Home    About    Download    Register    News    Help

Print Thread
on tabcomp :error handling #175785 28/04/07 02:20 PM
Joined: Feb 2007
Posts: 8
B
blk_panther Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2007
Posts: 8
seems I get one error too much with the tabcomp:

Code:
on *:tabcomp:*:{
  ;a = wort der editbox bei cursor; b = alles der editbox; c = stelle des wortes bei cursor (wenn normal 0 weil cursor vor erstem wort (leerzeilen), setze c = 1)
  var %c = $iif($numtok($left($editbox($active),$editbox($active).selstart),32) == 0 && %b,1,$v1)
  var %b = $editbox($active)
  var %a = $gettok(%b,%c,32)

  if $regex(%a,/(\$asc\([\x2C{}()]\))/) {
    var %t = $eval($replace($regml(1),$!asc(,),44,$!asc( $+ $chr(40) $+ ),40,$!asc( $+ $chr(41) $+ ),41,$!asc({),123,$!asc(}),125),2), %i = $calc($iif(%c == 1,1,2 + $len($gettok(%b,1- $calc(%c -1),32)))+ $len(%t))
    editbox $+(-ab,%i,e,%i) $puttok(%b,%t,%c,32)
    halt
  }
  var %t = $eval(%a,2), %i = $calc($iif(%c == 1,1,2 + $len($gettok(%b,1- $calc(%c -1),32)))+ $len(%t))
  if (!%t) { beep 1 | halt }
  editbox $+(-ab,%i,e,%i) $puttok(%b,%t,%c,32)
  halt

  :error
  echo -acg info $gettok($error,1,40) eigener
  beep 1
  reseterror
}


gives:
* Too many parameters: $gettok
* Too many parameters: $gettok eigener

second one is ok, but where the **** does the first one come from, and why I can't halt it?

what I do: type $gettok(a,b,c,d)[tab]

works well on identifiers without error or on previous mirc version (atm using: 6.21)

Re: on tabcomp :error handling [Re: blk_panther] #175827 29/04/07 01:00 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
mIRC evaluates the text if it is an identifier or variable before passing it on to on TABCOMP. So the first $gettok error is generated before the on TABCOMP is triggered. I could change it so that the text is evaluated after on TABCOMP. This might change the way on TABCOMP works for some people though.

Re: on tabcomp :error handling [Re: Khaled] #175831 29/04/07 01:37 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Could you not make it so ^*:tabcomp: is before and *:tabcomp: is after?

Re: on tabcomp :error handling [Re: Khaled] #175849 29/04/07 05:17 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Adding the ^ prefix would make TABCOMP conform with most existing mIRC events. And as shown in the above example, there is an obvious use for it.

-genius_at_work

Re: on tabcomp :error handling [Re: hixxy] #175940 30/04/07 08:34 PM
Joined: Feb 2007
Posts: 8
B
blk_panther Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2007
Posts: 8
let me check, ... didn't he?

ok thx, ... and next time, ... I promise (even if I posted 2 "bugs" that actually arn't bugs) I will check it even more (this time I spend a whole day, ... much ppl confirmed that bug, ... never trust anyone but the help (or smthn)

long story short: close or whatever (best ignore) smile

^works great

Re: on tabcomp :error handling [Re: blk_panther] #175966 01/05/07 07:34 AM
Joined: Feb 2007
Posts: 8
B
blk_panther Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2007
Posts: 8
ok let me check again: if I use on ^*:tabcomp... my event won't trigger but mirc's own does?

it's not supposed to do that, right? (after checking the helpfile, it says that tabcomp doesn't support ^ ... yes I'll vote for implement that ... if it fix my problem)

thx for all help

MfG


Re: on tabcomp :error handling [Re: blk_panther] #185916 15/09/07 10:43 PM
Joined: Feb 2007
Posts: 8
B
blk_panther Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2007
Posts: 8
thx 4 new version, works like a charm, ... one thing to note for next version: update /help halting default text -> add on tabcomp to the list (The ^ event prefix currently works only on the following types of events: ...)