mIRC Home    About    Download    Register    News    Help

Topic Options
#176028 - 01/05/07 10:34 PM $gettok invalid format (var error...)
GaMa Offline
Pikka bird

Registered: 25/03/06
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.


Edited by GaMa (01/05/07 10:57 PM)

Top
#176029 - 01/05/07 10:45 PM Re: $gettok invalid format [Re: GaMa]
Vliedel Offline
Ameglian cow

Registered: 01/05/07
Posts: 27
did you try: var %temp.odderror = $gettok(... ?

Top
#176031 - 01/05/07 10:47 PM Re: var = error xD [Re: GaMa]
GaMa Offline
Pikka bird

Registered: 25/03/06
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...

Top
#176037 - 02/05/07 12:37 AM Re: var = error xD [Re: GaMa]
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
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.

Top
#176038 - 02/05/07 12:48 AM Re: var = error xD [Re: hixxy]
GaMa Offline
Pikka bird

Registered: 25/03/06
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.

Top
#176042 - 02/05/07 12:59 AM Re: $gettok invalid format (var error...) [Re: GaMa]
Om3n Offline
Fjord artisan

Registered: 06/07/03
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

Top