QPR Knowledge Base

CloseModel

Hide Navigation Pane

CloseModel

Previous topic Next topic No expanding text in this topic  

CloseModel

Previous topic Next topic JavaScript is required for expanding text Mail us feedback on this topic!  

Comments (...)

Revision history:

Introduced in QPR 7.2.1

 

Closes an open model. You can define whether the changes should be saved.

 

Synopsis:

 

PGModel.CloseModel(Save | No Save)

 

Parameters:

 

Save (1): Save possible changes to the model before closing

No Save (0): Do not save changes even if the model was changed.

 

Required Rights:

 

None.

 

Return Values:

Below are listed the return values that this function can return:

 

RV_SUCCESS

RV_APPLICATION_QUIT_CALLED

RV_CANNOT_CLOSE_MODEL

 

Example Procedure:

 

Sub CreateAndSaveFileModels()

 Dim iResult

 Dim oModel

 iResult = PGApplication.CreateModel(True, "", oModel)

 If (iResult <> 0) Then

   MsgBox "Create file model 1 failed: " + PGApplication.GetErrorMessage(iResult)

 End If

 

 iResult = oModel.SaveFileModelAs("C:\Temp\Scripting\DefaultSettings.pmf")

 If (iResult <> 0) Then

   MsgBox "Save file model 1 as failed: " + PGApplication.GetErrorMessage(iResult)

 End If

 

 iResult = oModel.CloseModel(1)

 If (iResult <> 0) Then

   MsgBox "Close file model 1 failed: " + PGApplication.GetErrorMessage(iResult)

 End If

 Set oModel = Nothing

End Sub

Comments (...)