Suppression d'un objet dans un modèle à l'aide de scripts

Vous supprimez un objet dans le modèle à l'aide de la méthode Delete As Boolean.

Exemple

If not ExistingModel is Nothing Then
   ' Create another class first
   Dim MyClassToDelete
   Set MyClassToDelete = ExistingModel.Packages.CreateNew()
   If not MyClassToDelete is Nothing then
      output "The second class has been successfully created"
      ' Just call Delete method to delete the object
      ' This will remove the object from the collection of model classes
      MyClassToDelete.Delete
      ' The object is still alive but it has notified all other
      ' objects of its deletion. It is no more associated with other objects.
      ' Its status is deleted
      If MyClassToDelete.IsDeleted() Then
         output "The second class has been successfully deleted"
      End If
      ' The reset of the VbScript variable will release the last
      ' reference to this object abd provoke the physical destruction
      ' and free the memory
      Set MyClassToDelete = Nothing
   End If
End If


Created October 8, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com