Set the value of a Constant, Lookup String Variable or, in gaming mode, a Game Input. var must be a valid Constant, Lookup, String Variable or Game Input. For Constants and Game variables val can be either a number (3.5) or a valid model variable name. For Lookups there can only be numbers. Whatever appears for String Variables is simply taken as a literal express (you do not need to enclose it in single quotes ').
NOTE You can only change Constants, Lookups and String Variables during a simulation setup. If you have executed the MENU>GAME command nothing will happen.
NOTEYou can only change Game Variables during a game. If you have not executed the MENU>GAME command nothing will happen.
If you are setting Constants, you can only set them to other constants, but Vensim will not check this so be careful. If you are setting Game variables, you can set them to any valid model variables.
If you use subscripted variables in the SETVAL command you will need to surround the command in double quotes " ". To change a Lookup using the SETVAL you must supply a sequence of x,y pairs in parentheses as in
SIMULATE>SETVAL|mylookup((0,0),(1,1),(2,2),(5,5))
If you are using the SETVAL command to set a string variable do not include the surrounding single quotes. For example:
SIMULATE>SETVAL|productname:IS:Metronone
If you use the SETVAL command and have input controls on the screen you should also use the SPECIAL>RESETINPUT command or reenter the current screen.