mIRC Homepage
Posted By: Netchelandorious /tokenize problem using "" - 09/03/04 08:48 AM
alias mytest { tokenize 34 $1- | echo Result: $1 - $2 }

/mytest "file 1.txt" "file 2.txt"
Result: file 1.txt -

alternative method:
alias mytest { tokenize 34 $replace($1-, " ", ") | echo Result: $1 - $2 }

/mytest "file 1.txt" "file 2.txt"
Result: file 1.txt - file 2.txt

Posted By: qwerty Re: /tokenize problem using "" - 09/03/04 10:34 AM
Where exactly is the bug? All I can see is the standard way mirc treats tokens. In case you didn't notice either, $2 is not empty; it returns a space, ie the part of text between the 2nd and 3rd separator (leading and trailing token separators are stripped off). $gettok("file 1.txt" "file 2.txt",2,34) returns a space too.
Posted By: Netchelandorious Re: /tokenize problem using "" - 09/03/04 10:50 PM
Good eye. LOL I didn't think that parameters could possibly contain just a space. It works as you described.
Posted By: Online Re: /tokenize problem using "" - 09/03/04 11:40 PM
It wouldn't hurt to have a new tokenize-like command in future versions of mIRC that will allow us to reorganize $N so that everything inside quotation mark will be considered a single parameter. mIRC already does that with some of its internal commands, for example, when you pass a "long filename" to /write.

As for now, you can call your alias as an identifier: $mytest(file 1,file 2)
© mIRC Discussion Forums