mIRC Home    About    Download    Register    News    Help

Print Thread
#90838 17/07/04 08:06 PM
Joined: Jul 2004
Posts: 2
H
Bowl of petunias
OP Offline
Bowl of petunias
H
Joined: Jul 2004
Posts: 2
set %var ,,hi
echo -a $gettok(%var,1,44) its returns hi when it must return ,hi
well this is just an example the same happens with any tokken identifier that uses a coma.

#90839 17/07/04 08:21 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
This is correct behaviour. All token identifers treat consecutive delimiters as one, and ignore leading and trailing delimiters.

So if your delimiter is a comma ($chr(44)) then these are the same:
hi
,,,,hi,,,,,,,,,,,
,hi,
They all consist of 1 token hi. a delimiter is never part of a token.

Also these 2 would be equivalent
a,b,c,d,e
,,,,a,,,,,,,b,,,,c,d,,,e,,
For both strings the first token is a, the third c and the last e.


#90840 17/07/04 08:28 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
qwerty's $gettokn() works the way you want.


Link Copied to Clipboard