mIRC Home    About    Download    Register    News    Help

Print Thread
#74552 09/03/04 08:48 AM
Joined: Dec 2002
Posts: 31
N
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


Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Dec 2002
Posts: 31
N
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.

Joined: Dec 2002
Posts: 1,922
O
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)


Link Copied to Clipboard