Difference between revisions of "var.monitor"
Jump to navigation
Jump to search
Jimbauwens (talk | contribs) |
Jimbauwens (talk | contribs) |
||
Line 3: | Line 3: | ||
<br> | <br> | ||
− | This function turns on monitoring of a variable (given in the arguments). When another script/program modifies the variable it will trigger on.varChange.<br> | + | This function turns on monitoring of a variable (given in the arguments). When another script/program modifies the variable it will trigger [[on.varChange|on.varChange]].<br> |
== Syntax == | == Syntax == |
Revision as of 13:34, 1 June 2011
var.monitor is a function that is part of the Var Library.
This function turns on monitoring of a variable (given in the arguments). When another script/program modifies the variable it will trigger on.varChange.
Syntax
var.monitor(varname)
starts monitoring the variable varname (must be a string).
Example
function on.create()
var.monitor("sol")
--turn monitoring on for the variable "sol"
end
function on.varChange(list)
--The variable got changed!
return 0 -- allow the change
end