mIRC Home    About    Download    Register    News    Help

Print Thread
$gettok bug. #16703 24/03/03 06:31 AM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
To see the sucker in work try:
//echo $gettok(.........WHY?....., 1, $asc(.))

It will return WHY?
why?
Don't get me wrong, but why? is hardly the first token. I doubt there will me much resistance on this point. But, I often delinate data I store with ; or . or some other character I know I won't use in the data itself. The problem is sometimes the data is empty, and in these cases I have to put a zero and code that a zero means null or the bugger gives me the next items which really isn't right...

Re: $gettok bug. #16704 24/03/03 06:52 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
i dont think thats really a bug because to separate ur gettok its asking for it to say what is the first match between the ... in there ....... test it filling in the spaces between the dots with something like

//echo $gettok(.a.s.d.f.g.h.j.u.WHY?....., 9, $asc(.))

and it also will now return WHY? but using 1 it returns a
by having the . (dots, periods) thats the separator in the line ..... i dont think thats really a bug but maybe ur usage of it thats kinda off a lil ....... altho i could be mistaken


D3m0nnet.com
Re: $gettok bug. #16705 24/03/03 10:17 AM
Joined: Mar 2003
Posts: 31
G
GBX Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Mar 2003
Posts: 31
i also dont believe that this is a bug
i already wrote a gettok function and used the same strategy, because this is so more useful
i am not sure how you want to store that data, but maybe using indexed dynamic variables or ini entries would be better

Re: $gettok bug. #16706 24/03/03 06:16 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
This isn't a bug, token identifiers are designed this way (they ignore empty/null tokens).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $gettok bug. #16707 24/03/03 11:02 PM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
ok see i thought it was like that but um i wasnt positive thats why i sai i could be wrong ....... lol good to see someone else agreeswith my opinion


D3m0nnet.com
Re: $gettok bug. #16708 25/03/03 03:40 PM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Hmmm, somehow I think it should return $null when the token is null.

Re: $gettok bug. #16709 25/03/03 03:43 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
That would break a hell of a lot of scripts... perhaps a new switch for the identifiers would be nice, but that would be a feature suggestion, not a bug.

Re: $gettok bug. #16710 25/03/03 04:32 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I'd rather see $null tokens added and have broken scripts then have half-measures and workarounds for the sake of compatability.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: $gettok bug. #16711 25/03/03 04:44 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Perhaps its not the prettiest way of doing things, but it's hardly a workaround or a half-measure, it's an option, and IMO hardly an option work screwing up alot of scripts for either.

Re: $gettok bug. #16712 25/03/03 05:59 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The ability to have $null tokens, both in the token identifiers and in $N would be a very useful extension to the scripting language. Certainly worth the occasions that it messes up old scripts in my opinion.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: $gettok bug. #16713 25/03/03 06:02 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
It is scriptable for the token identifiers (I mean to make your own), but not for the $n ones (which would be useful), so since it would be stupid to do one without the other I'll change my vote (i.e. you win frown).

Re: $gettok bug. #16714 26/03/03 07:22 PM
Joined: Dec 2002
Posts: 117
R
Rich Offline
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
How about $gettok(...).all or something (for all token identifiers) that would include $null tokens for counting while $gettok(...) would return the same.


$input(Me like stars, You too?)
Re: $gettok bug. #16715 20/04/03 03:56 PM
Joined: Feb 2003
Posts: 32
S
SaX0n Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Feb 2003
Posts: 32
I agree. Logically mirc should return * /echo: insufficient parameters, when this is typed:

//echo -a $gettok(one@@three,2,64)

Ive scripted mIRC for a long time, and this is how I would expect mIRC to act. That fact that mIRC returns 'three' is inconsistent and unuseful in my opinion. I don't know why we should presume that Khaled intended it to perfom this way... Nobody knows that. This COULD be a bug, If it isn't, In my opinion, it's a design flaw, and should be fixed. Who cares if breaks 'Ultr4 D34tH ScRiPT' on mIRC 5.6...