Event Scripts

Use the Event Scripts screen to specify scripts (VBScript or JScript, or any other script languages that you have installed on your computer, such as Python, Perl or Ruby) that will run at various times before, during and after WEAP's calculations.  You can use these scripts to do additional calculations or perform other processing of data or results.  Use the browse buttons to select a script file for each event.  Optionally, you can specify a specific function to run within each script file, using the Call syntax, e.g., Call( ReservoirTemperature.vbs ! Initialize )  If no function is specified, WEAP will run the module-level commands in the script (i.e., those that are not inside a function or sub).  Each script has access to all of the objects in WEAP's API.  Leave one or more of the edit boxes blank if you do not want scripts to run during certain calculation events.   

The names of the event scripts are saved along with the rest of your data for each area (data set).  Thus, a different set of scripts can be run for each area.  It is recommended that you store the actual scripts (typically .VBS or .JS files) in the current area folder so that they will be backed-up and can be moved along with the rest of the area data.

The order in which the events occur within WEAP's calculations is indicated by the indentation of the text boxes on the Event Scripts screen, and is as follows:

Before Calculation (once before entire calculation)

Before Scenario (for each scenario)

Before Year (for each scenario/year)

Before Month (for each scenario/year/month)

Before Demand calculations

Before Supply calculations

Before Cost calculations

Before running MODFLOW

Before Water Quality calculations

After Month

After Year

After Scenario

After Calculation (once after entire calculation)

Menu option: Advanced, Scripting, Events
See also
: Scripting, Script Editor, Automating WEAP (API)