mIRC Home    About    Download    Register    News    Help

Topic Options
#175785 - 28/04/07 03:20 PM on tabcomp :error handling
blk_panther Offline
Nutrimatic drinks dispenser

Registered: 24/02/07
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)

Top
#175827 - 29/04/07 02:00 PM Re: on tabcomp :error handling [Re: blk_panther]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4344
Loc: London, UK
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.

Top
#175831 - 29/04/07 02:37 PM Re: on tabcomp :error handling [Re: Khaled]
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
Could you not make it so ^*:tabcomp: is before and *:tabcomp: is after?

Top
#175849 - 29/04/07 06:17 PM Re: on tabcomp :error handling [Re: Khaled]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#175940 - 30/04/07 09:34 PM Re: on tabcomp :error handling [Re: hixxy]
blk_panther Offline
Nutrimatic drinks dispenser

Registered: 24/02/07
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

Top
#175966 - 01/05/07 08:34 AM Re: on tabcomp :error handling [Re: blk_panther]
blk_panther Offline
Nutrimatic drinks dispenser

Registered: 24/02/07
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


Top
#185916 - 15/09/07 11:43 PM Re: on tabcomp :error handling [Re: blk_panther]
blk_panther Offline
Nutrimatic drinks dispenser

Registered: 24/02/07
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: ...)

Top