mIRC Home    About    Download    Register    News    Help

Print Thread
#83080 15/05/04 04:09 PM
Joined: May 2004
Posts: 17
S
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
Posts: 17
I want to retrieve a certain token from a variable with this code:
Quote:

set %temp $gettok(%temp,1,44)

and I want to display a message if a token were found, if not, another message: example
Quote:

if( %temp != $null) { msg $active %temp}
else { msg $active no token found! }


This code doesn't work frown
Thanks

#83081 15/05/04 04:51 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You need a space between if and (, if (, not if(.


New username: hixxy
#83082 15/05/04 06:09 PM
Joined: May 2004
Posts: 24
K
Ameglian cow
Offline
Ameglian cow
K
Joined: May 2004
Posts: 24
You need a space between the var and } too.

#83083 15/05/04 07:35 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
if ($gettok(%temp,1,44)) { msg $active $ifmatch }
else { msg $active no token found! }


To check if a token exists: $istok(%temp,44)


#83084 15/05/04 08:23 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hello,

Code:
 
msg $active $iif($gettok(%temp,1,44) != $null, $ifmatch, no token found!)

Greetz

Edit
Wolfie: $istok(text,token,C)

Later mate!

Last edited by FiberOPtics; 15/05/04 08:26 PM.

Gone.
#83085 15/05/04 09:40 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Oops, I mixed up with $numtok.
Which in their usage, if ($numtok(%temp,44)) { token exists }

Oh well.
cool


Link Copied to Clipboard