mIRC Home    About    Download    Register    News    Help

Print Thread
#207378 14/12/08 08:06 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
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 }

firefox #207379 14/12/08 08:09 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Yes. ;-)

5618 #207380 14/12/08 08:11 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
thanks 5618

firefox #207422 16/12/08 04:30 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
/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,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I'm not telling him not to post here. I'm just trying to help him test his own code.


Link Copied to Clipboard