mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
Hi guys...

I got this code and it reads a line with userinfo all seperated by spaces.
(Example: Div irchighway me haha)
My script intents to place all this data together seperated by dots.
The only way I figured would work is with $gettok

Although there seems to be something tricky...

as you can see below I call an echo just in the same way I want to define my local variable %temp. Only the echo return without issues, but when trying to assign the local variable %temp, it tells me: Invalid format: $gettok on the line where %temp is assigned... What am I doing wrong?
Or does anyone know a better way?

Code:
var %testdot $gettok(%test,1,32)
var %c 2
echo -a starting $gettok(%test,%c,32)
while ($gettok(%test,%c,32) != $null) {
  echo -a starting2 $gettok(%test,%c,32)
  var %temp $gettok(%test,%c,32)
  var %testdot %testdot $+ . $+ %temp
  unset %temp
  inc %c
  echo -a dots = %testdot
}


Thanks in advance for all replies!

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
This is because you are using /var incorrectly, ie without the = sign. The correct syntax according to the help file is
/var %name = value

Although omitting = often works, you just found out when it doesn't.

Btw, it's always good to code stuff yourself initially, to get the hang of the language, but you could simply use $replace(%test,$chr(32),.)

Last edited by qwerty; 10/05/06 01:49 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard