AIMMS Function Reference - Data Change Monitor Functions This file contains only one chapter of the book. For a free download of the complete book in pdf format, please visit www.aimms.com Aimms 3.13
Data Change Monitor Functions To keep track of which data has been changed during a session, you can define one or more Data Change Monitors. The following functions are for creating and maintaining these monitors: DataChangeMonitorCreate DataChangeMonitorDelete DataChangeMonitorHasChanged DataChangeMonitorReset
Data Change Monitor Functions 219 DataChangeMonitorCreate With the function DataChangeMonitorCreate, you can create a new data change monitor. With a data change monitor, you can determine whether any identifiers in a subset of AllIdentifiers have been changed since the latest call to DataChangeMonitorCreate or DataChangeMonitorReset. To check for any changes, you can use DataChangeMonitorHasChanged. DataChangeMonitorCreate(,! (input a scalar string expression monitoredidentifiers,! (input subset of AllIdentifiers [excludenonsaveables]! (optional 0 or 1 A string identifying a (new data change monitor. monitoredidentifiers The subset of identifiers that you want to monitor for this data change monitor. excludenonsaveables (optional If the data change monitor is used to monitor whether or not a subset of identifiers needs to be saved, it is unnecessary to include identifiers that have the Nosave property. If you set this argument to 1, these identifiers will automatically be excluded from the given subset of identifiers. The default of this argument is 1. This exclusion is applied also on any subset that is passed in later calls to DataChangeMonitorReset. The function returns 1 upon success. If there already exists a data change monitor for the given, the function returns 0. In case of any other error, it returns 1. If the return value is 0 or 1 CurrentErrorMessage will contain a proper error message. Remarks: The newly created monitor is reset automatically, so there is no need to call the function DataChangeMonitorReset immediately after creation. If your project uses the Data management style Disk files and folders, Aimms itself uses a data change monitor to keep track of whether the active data needs to be saved before exiting, or before loading any new data. The of this internal data change monitor is given by the predeclared string parameter DataManagementMonitor.
Data Change Monitor Functions 220 The functions DataChangeMonitorHasChanged, DataChangeMonitorReset, DataChangeMonitorDelete.
Data Change Monitor Functions 221 DataChangeMonitorDelete With the function DataChangeMonitorDelete, you can delete a data change monitor that was created using the function DataChangeMonitorCreate. DataChangeMonitorDelete(! (input a scalar string expression A string identifying an existing data change monitor. The function returns 1 upon success. If there exists no data change monitor for the given, the function returns 0. In case of any other error, it returns 1 and CurrentErrorMessage will contain a proper error message. The functions DataChangeMonitorCreate, DataChangeMonitorReset, DataChangeMonitorHasChanged.
Data Change Monitor Functions 222 DataChangeMonitorHasChanged The function DataChangeMonitorHasChanged returns whether the data of any identifier that is monitored by the specified data change monitor has been changed since a previous call to DataChangeMonitorCreate or DataChangeMonitorReset. DataChangeMonitorHasChanged(! (input a scalar string expression A string identifying an existing data change monitor. The function returns 1 if any of the identifiers monitored by the data change monitor has been changed since a previous call to either DataChange- MonitorCreate or DataChangeMonitorReset. If none of the identifiers has been changed, the function returns 0. In case of any other error, it returns 1 and CurrentErrorMessage will contain a proper error message. If the monitored set contains identifiers that were not present in that set at the previous call to either DataChangeMonitorCreate or DataChangeMonitorReset, these identifiers are assumed to be changed, and the function returns 1 as well. Remarks: Calling DataChangeMonitorHasChanged does not reset the data change monitor. The functions DataChangeMonitorCreate, DataChangeMonitorReset, DataChangeMonitorDelete.
Data Change Monitor Functions 223 DataChangeMonitorReset The function DataChangeMonitorReset assigns a new set of identifiers to an existing data change monitor and resets the monitor to the unchanged status. DataChangeMonitorReset(, monitoredidentifiers! (input a scalar string expression! (input subset of AllIdentifiers A string identifying an existing data change monitor. monitoredidentifiers The subset of identifiers that should be monitored by the data change monitor. The function returns 1 upon success. If there exists no data change monitor for the given, the function returns 0. In case of any other error it returns 1 and CurrentErrorMessage will contain a proper error message. The functions DataChangeMonitorCreate, DataChangeMonitorHasChanged, DataChangeMonitorDelete.