mIRC Home    About    Download    Register    News    Help

Print Thread
#207378 14/12/08 08:06 PM
F
firefox
firefox
F
Quote:
$istok(text,token,C)

Returns $true if token exists, otherwise returns $false.


if I have a var with 'this that they' in it - i.e. a number of words seperated by a space

and I want to do if $2 is equal to one of the words in the var is this the correct way to do it?

if $istok(%var,$2,32) { haltdef }

#207379 14/12/08 08:09 PM
5
5618
5618
5
Yes. ;-)

#207380 14/12/08 08:11 PM
F
firefox
firefox
F
thanks 5618

#207422 16/12/08 04:30 AM
Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
/echo -a . Istok $istok(%var,$2,32)

This is how I test identifiers when I am writing scripts. I do a lot of this. Using echo can answer questions like this much faster than a forum.

DJ_Sol #207423 16/12/08 04:47 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Presuming that you have the correct format in your test.
I don't know how many times I've seen someone ask why something wasn't working, and the reason was that they were missing one or more parameters, or that they had parameter(s) in the wrong location(s).

RusselB #207497 19/12/08 01:51 PM
Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
I'm not telling him not to post here. I'm just trying to help him test his own code.


Link Copied to Clipboard