How do I delete a declared variable programmatically?
Posted: Fri Sep 18, 2015 2:56 pm
For example, in this pseudocode
I'd like to reset the variable "fcast_model" to be an empty model, so I can reuse it (in my actual code, it's part of a complicated loop). Is there any way to do this, besides creating an additional variable, i.e.
This is a more general question than just how to empty a model of its equations, although I looked for a function like %rlempty() that corresponded to the "model" data type.
Code: Select all
declare model fcast_model
* add some equations to fcast_model, compute a forecast, etc.
Code: Select all
declare model fcast_model
* add some equations to fcast_model, compute a forecast, etc.
declare model empty_model
compute fcast_model = empty_model
* fcast_model is now empty and can be reused for another loop iteration