Introduced in QPR 7.2.1
Last changed in QPR 2012.2
Saves the active model. If the model is open in read-only mode or it is a new model, name for the file or the model is prompted. If the model is open in read-only mode or it is a new model and UI mode is set to "silent", the operation fails and returns an error code. Error code is returned also if there are no models open when the command is used. With models that use version control the save behavior depends on the settings. If "Save changes to the current version" is selected, SaveModel saves the changes to the current version. In the case "Save as new model version" is selected, a new version is created. If the "Prompt" mode is used, a dialog is displayed asking whether the model should be saved as a new version. Note that in the Prompt mode user interface must not be hidden, since otherwise the function fails.
Below are listed the return values that this function can return:
iResult = PGModel.SaveModel()
If (iResult <> 0) Then
MsgBox "Saving the model failed: " + PGApplication.GetErrorMessage(iResult)