This is an old revision of the document!
Subroutines are reusable code files that can be called from views. The advantage of using them is there is only one copy of common code which makes it more maintainable and also gives consistency to how you interact with your views.
We have developed a set of subroutines you can use as a starting point. Below is a .zip file which is a package of files to get you started and the rest of this article describes how to use them.
This is the subroutine package that should be unzipped in your model account directory. Something like /models/myModel/Vx/views to create a subdirectory called subroutines.
Please consider these use at your own risk. We are not supporting them but are just providing them as a starting point from which you can modify them as you wish!
whatIf? Team members: Please look in /models/caness/V5/subroutines for the most current subroutines and under there find TemplateExamples for the most up to date templates.
Once you have extracted the files there are 3 files you must copy and adjust for your current model/version
getModelVersion_CopyAndCustomize.t
getProjectNames_CopyAndCustomize.t
informs_CopyAndCustomize.samm
Sub-routines are only available to views running in SAMM once the are loaded into the model family. Here's how to do that.
Now you are ready to write views that use subroutines. See below info about the examples that are a part of the sub routine bundle you have downloaded and extracted.
In that new folder you will find an examples sub folder with some example views:
levelVarProjection.t
shareVarProjection.t
usingGetModelVersion.t