mIRC Home    About    Download    Register    News    Help

Print Thread
/var bug #173136 21/03/07 03:39 AM
Joined: Oct 2005
Posts: 21
P
poiuy_qwert Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Oct 2005
Posts: 21
If you set a variable with the /var command, then try to use that variable in another /var command, it will not work. For example:
Code:
alias badvar {
  var %a 1,%b $iif(%a,a,b)
  echo %b
}

Will give you * /echo: insufficient parameters. The only way to make it work is to do:
Code:
alias badvar {
  var %a 1,%b = $iif(%a,a,b)
  echo %b
}


- poiuy_qwert
Re: /var bug [Re: poiuy_qwert] #173137 21/03/07 03:53 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Both of those work correctly for me. Neither is actually using the correct syntax for the var command though. It should be:
Code:
alias badvar {
  var %a = 1,%b = $iif(%a,a,b)
  echo %b
}
which works fine too.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: /var bug [Re: poiuy_qwert] #173152 21/03/07 01:49 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
When using /var, the correct syntax is to *always* use an = sign. This prevents problems when you try setting a local variable (/var) with an identifier's value.


Invision Support
#Invision on irc.irchighway.net