ISEE.SETVALUE

When working with ISEE.SETVALUE use this function to set the value of a single model variable. Setting values works the same way as controlling values from the interface using sliders and other Input Objects

ISEE.SETVALUE(<variable_name>, <value>, [<reset_to_interval>, [<reset_to_value>]])

The ISEE.SETVALUE function is used to set the value for a variable. The variable_name must be a variable name, or an expression that evaluates to a variable name with all array dimensions specified when applicable. value is the value to set the variable to. If used with just two arguments the variable will hold that value at all times during the simulation. If the optional reset_to_interval is supplied the value will be changed after that interval. Because the model is running every time the spreadsheet is calculated, the reset interval is relative to the start time for the model. If reset_to_value is specified this is the value that the variable will take on after the reset interval. If it is left blank the variable will return to the value it would have had without this function call.

Note If you call ISEE.SETVALUE on the same variable more than once the results will be unpredictable as the execution order of the commands is not guaranteed.

Note If you combine ISEE.SETVALUE with ISEE.SETDATA for the same variable the results will again be unpredictable.

If successful, ISEE.SETVALUE returns the value being set. On failure it returns #value to indicate an error.

Examples:

ISEE.SETVALUE("initial population",20) sets the value of the variable initial population to 20 and displays 20 in cell.

ISEE.SETVALUE("inventory["&C3&"]",C4) sets the value of inventory with the array dimension in cell C3 to the value in cell C4 and returns the value in C4. Dragging or pasting this formula will set subsequent elements.

ISEE.SETVALUE("not a variable",33) does nothing and returns #value.

Note You can use spaces or underbars in variable names.

Note To get a list of all variable names