mIRC Home    About    Download    Register    News    Help

Print Thread
#59991 12/11/03 04:58 PM
Joined: Nov 2003
Posts: 2
L
LND Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Nov 2003
Posts: 2
I'm trying to find the '?' in a variable i got called %topic ,with //echo -a $findtok(%topic,$chr(63),1,32)

$chr(63) standing for ? (questionmark)


the %topic variable contains this;
Next Game: 1:Player1 2:Player2 3:Player3 4:Player4 5:? 6:? 7:? 8:?

Altho i get the msg ->* /echo: insufficient parameters frown
I don't get whats wrong. I'm 100% sure the %topic variable contains the info. i use $chr(63) as token to find ?, 1 for the 1st questionmark, and 32 (space) as token seperator. What can it be?

Thnx in advance

#59992 12/11/03 05:15 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You should use $matchtok, $findtok only finds exact matches.

#59993 12/11/03 05:17 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Try this: $wildtok(%topic,*:?,1,32)

#59994 12/11/03 05:18 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
$findtok is used to find the entire token in the string (ie $findtok(a? b? c? d?,c?,1,32) ). Use $matchtok(%topic,?,1,32) instead.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#59995 12/11/03 05:21 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
The problem with this is that ? is a wildcard character inside $wildtok(), so it could incorrectly find an entry like 8:a

...although in this case, it may never be encountered

Last edited by qwerty; 12/11/03 05:22 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#59996 12/11/03 05:29 PM
Joined: Nov 2003
Posts: 2
L
LND Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Nov 2003
Posts: 2
aaah. Great it's solved now. thank you cool


Link Copied to Clipboard