mIRC Home    About    Download    Register    News    Help

Print Thread
G
GaMa
GaMa
G
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.
V
Vliedel
Vliedel
V
did you try: var %temp.odderror = $gettok(... ?

#176031 01/05/07 09:47 PM
G
GaMa
GaMa
G
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...

#176037 01/05/07 11:37 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
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
G
GaMa
GaMa
G
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.

O
Om3n
Om3n
O
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


Link Copied to Clipboard