mIRC Home    About    Download    Register    News    Help

Print Thread
#181856 01/08/07 05:23 AM
Joined: Aug 2007
Posts: 3
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Aug 2007
Posts: 3
[SPANISH]
Bien, el otro dia intentando manejar URLS con "$gettok" se me presento un problema:

Cuando queria sacar la URL del archivo y acababa en el caracter de sepearacion del token no me devolvia ese ultimo caractarer:

$gettok(bug/gettok/mierda/joder/,1-,47)

Devuelve: bug/gettok/mierda/joder

$gettok(bug/gettok/mierda/joder///////////////,1-,47)

Devuelve: bug/gettok/mierda/joder



Cuando se añade algo mas final que no sea el caracter de separacion, ya funciona bien:

$gettok(bug/gettok/mierda/joder/SolucionFallo,1-,47)

Devuelve: bug/gettok/mierda/joder/SolucionFallo

$gettok(bug/gettok/mierda/joder///////////////SolucionFallo,1-,47)

Devuelve: bug/gettok/mierda/joder/SolucionFallo
[Como pueden comprobar, cuando se pone el caracter de separación más de una vez, tambien falla el codigo.]



Despues para sacar lo original (Recordad: bug/gettok/mierda/joder/):
$remove($gettok(bug/gettok/mierda/joder/SolucionFallo,1-,47),SolucionFallo)

Esto devuelve: bug/gettok/mierda/joder/




[ENGLISH]
Well, the other day trying to handle URLS with "$gettok" I appear a problem:

When it wanted to remove the URL from the file and finished in the character of sepearacion of they token did not give back that to me I complete to caractarer:

$gettok(bug/gettok/mierda/joder/,1-,47)
It gives back: bug/gettok/mierda/joder

$gettok(bug/gettok/mierda/joder///////////////,1-,47)
It gives back: bug/gettok/mierda/joder


When something but final is added that is not the separation character, it already works well:
$gettok(bug/gettok/mierda/joder/SolucionFallo,1-,47)
It gives back: bug/gettok/mierda/joder/SolucionFallo

$gettok(bug/gettok/mierda/joder///////////////SolucionFallo,1-,47)
It gives back: bug/gettok/mierda/joder/SolucionFallo
[As they can verify, when the character of separation more of once is put, also fails I cosay.]


Later to remove the original thing (You remember: bug/gettok/mierda/joder/):
$remove($gettok(bug/gettok/mierda/joder/SolucionFallo,1-,47),solucionfallo)
This gives back: bug/gettok/mierda/joder/

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
mIRC does not recognize null characters between token separators.

This has been brought up before, and quite a while back, someone did give me a script that worked perfectly as a workaround.

I don't currently use that script, but I will try to hunt it up, and, when found, post it (unless someone else beats me to it, that is)

Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
Use this. it will fix your tokens:
Code:
alias gettokn {
  var %a = \x $+ $base($3,10,16),%b,%r
  %r = $+(/,$chr(40),^,%a,*,|,$chr(40),?<=,%a,$chr(41),%a,*,|,%a,*$,$chr(41),/g)
  noop $regsub($1,%r,$null,%b)
  return $gettok(%b,$2,$3)
}


Kind Regards, blink
b1ink #181917 02/08/07 01:22 AM
Joined: Jan 2004
Posts: 162
R
RRX Offline
Vogon poet
Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
I wonder why this kind of longterm 'known scripting issues' aren't centralized on one place, maybe a separate forum section, where everybody can read but only site maintainers can post.

Personally, I 'hate' to search hours, days, ? to pinpoint a bug in a script due to issues in the language commands itself, only to find out later on its already known.

I believe such thing is called 'Knowledge Base'.

RRX #181929 02/08/07 10:24 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
I'm not sure what are you trying to say but I agree!


Kind Regards, blink

Link Copied to Clipboard