=====Future Value===== In the ON and OFF script of a unit a call to the [[valueof|value]] verb will return the current value of the unit, not the new value being set. In order to see what the future value of the unit will be you need to use the Future Value verb. ====Usage:==== **future value**\\ returns a real number that will be the value of unit after the new command is received. if (future value) > 300 then write log “Error in reading, setting to current value” color red change future value to (value of (thisUnit)) else write log “Reading Appears Valid, continue" end if ====Using with Enumerated Values:==== For Units with Enumerated Values you can use the optional “for” parameter to the [[dictionary:unitinformation:enumeratedvalue|enumerated value]] verb to get the enumeration for the future value. Without the “for" parameter it will return the enumeration for the current value and not the new value. By passing the future value, or any number within range, the correct enumeration can be read. write log “new enumerated value will be “ & (enumerated value for (futureValue)) ====Notes:==== * [[changefuturevalue|change future value]] * [[dictionary:unitinformation:enumeratedvalue|Enumerated Value Verb]]