mIRC Home    About    Download    Register    News    Help

Print Thread
Token functions #102839
13/11/04 02:52 PM
13/11/04 02:52 PM
Joined: Dec 2002
Posts: 27
S
silent Offline OP
Ameglian cow
silent  Offline OP
Ameglian cow
S

Joined: Dec 2002
Posts: 27
hi,

this is not important, but just for my interest wink
Should'nt the function names be like "$getpiece" instead of "$gettok" as u get a piece of a string and not the seperator (token)?

Last edited by silent; 13/11/04 02:52 PM.
Re: Token functions #102840
13/11/04 03:16 PM
13/11/04 03:16 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
token != seperator

The tokens are the actual pieces of strings, seperated by an ascii character 0-255, called the delimiter or seperator.

//tokenize 32 one two three | echo -a token1: $1 * token2: $2 * token3: $3 ** seperator: $($chr(32),0) (a space)

Perhaps you'll find this mini tutorial interesting.

Greets


Gone.
Re: Token functions #102841
13/11/04 07:40 PM
13/11/04 07:40 PM
Joined: Dec 2002
Posts: 27
S
silent Offline OP
Ameglian cow
silent  Offline OP
Ameglian cow
S

Joined: Dec 2002
Posts: 27
hi FiberOPtics,

thx for your post, i know how these functions work i was just wondering bout the names of it, because Token = Zeichen(in german) = 1 letter

Re: Token functions #102842
13/11/04 07:53 PM
13/11/04 07:53 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
Yeah,

but token = token (in english) = token smirk

mIRC script is in English.

Greets


Gone.
Re: Token functions #102843
13/11/04 08:01 PM
13/11/04 08:01 PM
Joined: Mar 2004
Posts: 457
Behind you
D
Danthemandoo Offline
Fjord artisan
Danthemandoo  Offline
Fjord artisan
D

Joined: Mar 2004
Posts: 457
Behind you
well, the English language is based on hundreds of other languages and it contains words from german, french, italian etc etc, so token probably does come from the german word.

Re: Token functions #102844
13/11/04 08:09 PM
13/11/04 08:09 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
It might very well come from many other languages, no doubt, however, in the mIRC Scripting language, a token is not a seperator, or 1 letter by definition. Nor is it in the present English language, which is the only thing that matters imo, in this discussion.

If token means "monkey" in Swahili, should we call it $getmonkey? Probably not.

Greets


Gone.
Re: Token functions #102845
13/11/04 10:17 PM
13/11/04 10:17 PM
Joined: Mar 2004
Posts: 457
Behind you
D
Danthemandoo Offline
Fjord artisan
Danthemandoo  Offline
Fjord artisan
D

Joined: Mar 2004
Posts: 457
Behind you
$getmonkey...lol grin

might have to use that next time i make a script cuz i'm forever running out of names for variables and things

Re: Token functions #102846
13/11/04 10:36 PM
13/11/04 10:36 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
Hehe laugh


Gone.
Re: Token functions #102847
13/11/04 11:29 PM
13/11/04 11:29 PM
Joined: Dec 2002
Posts: 27
S
silent Offline OP
Ameglian cow
silent  Offline OP
Ameglian cow
S

Joined: Dec 2002
Posts: 27
Quote:
If token means "monkey" in Swahili, should we call it $getmonkey? Probably not.


monkey is not a translation of "token", "zeichen" is german, but means EXACTLY the same as "Token" thats why i know a token is a character with length 1

Re: Token functions #102848
13/11/04 11:57 PM
13/11/04 11:57 PM
Joined: Dec 2002
Posts: 2,962
Norwich, UK
S
starbucks_mafia Offline
Hoopy frood
starbucks_mafia  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 2,962
Norwich, UK
Just because a word in one language means the same as another in a different language, doesn't mean they're the same in both langauges for all meanings of those words. A token in the computing sense is a gramatically indivisable unit of text, which you might misinterpret as meaning something one character long, but it is not the same thing. See here if you're unwilling to take my word for it.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: Token functions #102849
14/11/04 01:58 AM
14/11/04 01:58 AM
Joined: Mar 2004
Posts: 457
Behind you
D
Danthemandoo Offline
Fjord artisan
Danthemandoo  Offline
Fjord artisan
D

Joined: Mar 2004
Posts: 457
Behind you
i think what everyone is groping for and missing is that token was probably once a german word but was adapted into English god knows how long ago, not just for usage in this context. Thats certianly what i meant in my original post.