mIRC Home    About    Download    Register    News    Help

Print Thread
#234217 12/10/11 03:05 PM
Joined: Nov 2009
Posts: 17
A
AD1C Offline OP
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2009
Posts: 17
This line works:

  set %spotline %callsign %county1 $+ , %state1 %freq %mode

whereas this line does not:

  var %spotline %callsign %county1 $+ , %state1 %freq %mode

When using "var" instead of "set" the I get %callsign and %county1 in %spotline, but I don't get any of the rest of the line:

  10-12-2011 14:57 GMT - AD1C Erie

If I only change "var" to "set", I get it all:

  10-12-2011 14:57 GMT - AD1C Erie, NY 7056.5 CW

Any idea what's up with that?


Jim Reisert
http://www.ad1c.us/
Joined: Jul 2006
Posts: 4,153
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,153
This is because /var and /set doesn't share the same syntax:

Originally Posted By: /help /var
You can create multiple local variables by separating them with commas:

/var %x = hello, %y, %z = $me
var %spotline %callsign %county1 $+ , %state1 %freq %mode
A quick workaround is to use the -l switch on /set to make a local variable using the /set syntax



Last edited by Wims; 12/10/11 03:46 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As Wims pointed out, commas are used in /var to separate multiple variables on the same line. You can use /set -l as he mentioned, or you can replace the comma with $chr(44).

var %spotline %callsign %county1 $+ $chr(44) %state1 %freq %mode



Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2009
Posts: 17
A
AD1C Offline OP
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2009
Posts: 17
Thanks!


Jim Reisert
http://www.ad1c.us/
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
If you need variables to be referred to after your script has finished its routine at a later time, setting global variables are recommended over the local ones. The local variables are set temporarily and unset when a script has completed its task.


Link Copied to Clipboard