mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 16
G
GaMa Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Mar 2006
Posts: 16
How shall I explain this. Using gettok and setting it to a variable gives me the error. While just echo'ing the gettok command works perfectly fine. Here is how my code is set up.

Code:
  var %temp.dir = %mtm. [ $+ [ $replace(%temp.trig, $chr(32), $chr(46)) ] ]
  var %y = $numtok(%temp.dir,127)
  while (%y > 0) {
    echo -a %temp.dir
    echo -a $gettok(%temp.dir,%y,127)
    var %temp.odderror $gettok(%temp.dir,%y,127)
 


I placed the echo right next to the var to make sure, but it still gives the error when trying to set it.

Last edited by GaMa; 01/05/07 09:57 PM.
Joined: May 2007
Posts: 27
V
Ameglian cow
Offline
Ameglian cow
V
Joined: May 2007
Posts: 27
did you try: var %temp.odderror = $gettok(... ?

GaMa #176031 01/05/07 09:47 PM
Joined: Mar 2006
Posts: 16
G
GaMa Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Mar 2006
Posts: 16
Well well well, yep that works. I guess this is a more... var error. Since you don't need the equals for it to set it...

GaMa #176037 01/05/07 11:37 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The help file states you should use = in /var, if you don't use = to set your variables it's not really a bug in /var but in your script.

You could argue that /var shouldn't allow people to withhold the =, but that'd break too many scripts now.

hixxy #176038 01/05/07 11:48 PM
Joined: Mar 2006
Posts: 16
G
GaMa Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Mar 2006
Posts: 16
Oddly, I switch back and forth for some odd reason using an equals in a /var. This is the first time i've ran into this.

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
The equal sign is required when setting a local variable with data that evaluates from something containing a comma or for inline variables, i believe this is so mirc can more easily determine where the data for one variable ends and the data for another begine (at least thats my best guess). It is not a required part of the syntax in all circumstances due to the ability to create empty variables


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Link Copied to Clipboard