Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Model Change Flag
community documentation modeltype attrrep
Answer
3/27/14 12:15 PM
I just noticed that when an attribute value is modified via AdoScript in the currently opened model and the model is not saved by the AdoScript, it seems that the model change flag in ADOxx is not set - i.e. the user is not notified that a value has been changed in the current model when attempting to close it. Is this behavior intended or am I doing something wrong?

In more detail this occurs when I call an AdoScript via a button/programcall in a notebook that modifies a string valued attribute of the same object. After the attribute value has been modified by the script and the notebook is closed, the "save" icon has not changed to red (and there is no asterisk in the window title) and when the model is closed there is no dialogue asking if the changes should be saved (Unsaved changes dialogue).

RE: Model Change Flag
Answer
10/4/13 7:20 AM as a reply to Anonymous.
With respect, to the question/issues reported, this is actually intended behavior to support a temporary data/core layer during the execution of scripts of the CORE message port. Attributes/values can be changes within the scope of the loaded model (understood as a view(, used for further calculations and if you do not want to save, it would be discard when calling the CLOSE operation. An explicit SAVE_MODEL is needed to persist then in the DB. For the scenario you describe, the following construct would mark the model as modified:

1# Get the current modelid, if not yet defined
2CC "Modeling" GET_ACT_MODEL
3# Change an attribute value (of attribute "Object's name in this case) to a specific value
4CC "Core" SET_ATTR_VAL objid: (12609) attrname:"Object's name" val:"DEMO"
5# Explicitly mark the model as modifed
6CC "Modeling" SET_MODIFIED (modelid) modified: (1)