mIRC Homepage
Posted By: AaronL 2 seperated words in a line - 11/04/06 12:53 PM
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
Posted By: mIRCManiac Re: 2 seperated words in a line - 11/04/06 01:16 PM
/help $gettok

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


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

this <--
Posted By: AaronL Re: 2 seperated words in a line - 11/04/06 01:48 PM
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
Posted By: mIRCManiac Re: 2 seperated words in a line - 11/04/06 01:49 PM
You're welcome, glad I could help.
Posted By: DaveC Re: 2 seperated words in a line - 11/04/06 07:29 PM
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?
© mIRC Discussion Forums