|
CARLITOHISPANO
|
CARLITOHISPANO
|
[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,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
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
Vogon poet
|
Vogon poet
Joined: Oct 2006
Posts: 166 |
Use this. it will fix your tokens:
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)
}
|
|
|
|
RRX
|
RRX
|
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'.
|
|
|
|
Joined: Oct 2006
Posts: 166
Vogon poet
|
Vogon poet
Joined: Oct 2006
Posts: 166 |
I'm not sure what are you trying to say but I agree!
|
|
|
|
|