mIRC Homepage
Posted By: nalAAlan /untokenize - 24/01/05 06:06 PM
$1-: hel. lo my dog is eat. ing a cat!
/untokenize 46 $1-
$1: hel lo
$5: eat ing

Basicly instead of seperating tokens, it combins them.
Posted By: DaveC Re: /untokenize - 24/01/05 06:41 PM
Quote:
$1-: hel. lo my dog is eat. ing a cat!
/untokenize 46 $1-
$1: hel lo
$5: eat ing

Basicly instead of seperating tokens, it combins them.


That doesnt make sence to me, your saying if it encounters a token seperator at the end of a $x join it to the next one?

Well assumuing you have spaces as your standard $x seperators you could do.

/tokinize 255 $replacex($1-,. $+ $chr(32),$chr(32),$chr(32),$chr(255))
Posted By: nalAAlan Re: /untokenize - 24/01/05 08:23 PM
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?

$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan
Posted By: starbucks_mafia Re: /untokenize - 24/01/05 11:05 PM
Quote:
$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


Based on your previous example, that would actually leave you with:
$1: cmd c:\program
$2: files\mirc $chan

Anyway, the problem with your idea of this command is that it either somehow 'knows' what the current tokens are meant to be or otherwise only works by treating spaces as the delimiting token.
ie.
/tokenize 44 cow,pig sheep,.duck
/untokenize 46 $1-

When evaluated it would become /untokenize 46 cow pig sheep .duck and so would result in $1 = cow, $2 = pig, and $3 = sheep duck, which is almost certainly not what the scripter would be expecting (or hoping) to happen.
Posted By: DaveC Re: /untokenize - 24/01/05 11:44 PM
Quote:
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?


Umm use something else, like $chr(13), but yes i know what your getting at.

Quote:
$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


From this Im getting the impression your having trouble passing parameters becuase some of them have spaces, there is a easy trick to getting around this.
say you have this
Code:
alias blah {
  echo -a The Instruction is $1
  echo -a The Folder is $2
  echo -a The Channel is $3
}


passing it /blah cmd "c:\program files\mirc" $!chan
is going to cause problems
>The Instruction is $1cmd
>The Folder is $2 "c:\program
>The Channel is $3 files\mirc"

but you can simply do this $blah(cmd,"c:\program files\mirc",$!chan)
>The Instruction is $1cmd
>The Folder is $2 "c:\program files\mirc"
>The Channel is $3 $chan

Im not sure if that above trick/method is going to be any help to u in what you want but i hope it might be (if u want to do anything specific at all smile ).
Posted By: nalAAlan Re: /untokenize - 25/01/05 12:14 AM
im not sure what i was talking about... must have been one of those things where i thought i had a good idea but i ddint. i think i wanted to reverse the tokenizing of a string so something like

/untokenize c[,c] text

tokenize 32 a s d f
$1: a
$2: s
$3: d
$4: f
untokenize 32 $1-
$1: a s d f

tokenize 46 a.s d.f
$1: a
$2: s d
$3: f
untokenize 46,32 $1-
$1:a.s
$2:d.f

so like it would like return it to the orginal string, then tokenize 32 the recovered string
Posted By: argv0 Re: /untokenize - 01/02/05 06:02 PM
I don't know if im reading this wrong
but in the original example, you could just remove the token delimiters:

$remove(he. lo world, $chr(46))

and that will join them....... if thats what you want then just use $remove
Posted By: argv0 Re: /untokenize - 01/02/05 06:05 PM
Quote:
Yes thats what I'm saying, it will put together two tokens, and what about strings that have $chr(255) in them?

$1-: cmd "c:\program files\mirc" $chan
/untokenize $asc(") $1-
$1: cmd
$2: c:\program files\mirc
$3: $chan


Keep in mind, this example is the equivalent of
/tokenize $asc(") $1-

its also the equivalent of $remove($1-,")

I still dont see the use of this command
© mIRC Discussion Forums