mIRC Home    About    Download    Register    News    Help

Print Thread
#146942 11/04/06 12:53 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi all.

for a addon i need to seperate 2 words in a line.
the line is for example: wordA WordB
to get the seconde word i use
Code:
set %word.b $read($mircdirtxtfiles\words.txt,s,$1-)

works, but how do i get the first word out of that line.
N.b. words are all different

Greetz
Aaron


Deridio fatum
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
/help $gettok

1st token
ascii character separating the tokens - 32 = space


//echo -a $gettok(this is an example,1,32) <--

this <--

Last edited by mIRCManiac; 11/04/06 01:22 PM.
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
yep. that was the solution.
i removed the ,S, in the $read en read the whole list voor the matching word. With $gettok i got the words i needed.
Thanxs for your help mIRCManiac

Greetz
Aaron


Deridio fatum
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
You're welcome, glad I could help.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
ummm just a fought...

Since Im pretty sure from memory using $read(<file>,s,<text>) searchs for lines that match using the passed <text> upto a word boundry, then the first word is going to match $1 anyway isnt it?


Link Copied to Clipboard