mIRC Home    About    Download    Register    News    Help

Print Thread
/tokenize problem using "" #74552 09/03/04 08:48 AM
Joined: Dec 2002
Posts: 31
N
Netchelandorious Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 31
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


Re: /tokenize problem using "" #74553 09/03/04 10:34 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: /tokenize problem using "" #74554 09/03/04 10:50 PM
Joined: Dec 2002
Posts: 31
N
Netchelandorious Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 31
Good eye. LOL I didn't think that parameters could possibly contain just a space. It works as you described.

Re: /tokenize problem using "" #74555 09/03/04 11:40 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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)