mIRC Home    About    Download    Register    News    Help

Print Thread
#16703 24/03/03 06:31 AM
T
Tat
Tat
T
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...

#16704 24/03/03 06:52 AM
Joined: Dec 2002
Posts: 1,518
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,518
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

#16705 24/03/03 10:17 AM
G
GBX
GBX
G
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

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

#16707 24/03/03 11:02 PM
Joined: Dec 2002
Posts: 1,518
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,518
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

#16708 25/03/03 03:40 PM
T
Tat
Tat
T
Hmmm, somehow I think it should return $null when the token is null.

#16709 25/03/03 03:43 PM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
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.

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

#16711 25/03/03 04:44 PM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
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.

#16712 25/03/03 05:59 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
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.

#16713 25/03/03 06:02 PM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
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).

#16714 26/03/03 07:22 PM
Joined: Dec 2002
Posts: 117
R
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.

#16715 20/04/03 03:56 PM
S
SaX0n
SaX0n
S
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...


Link Copied to Clipboard