Siebel VB Language Reference > VB Language Reference >

Nothing Function

This standard VB function removes an instantiated object from memory.


Set objectName = Nothing



The name of the object variable to set to Nothing


Not applicable


Nothing is the value object variables have when they do not refer to an object, either because they have not been initialized yet or because they were explicitly set to Nothing. For example:

If Not objectVar Is Nothing then
objectVar = Nothing
End If

Use the Nothing function to remove an object that you have instantiated from memory.


This example adds an activity record indicating that a contact has been added when a new contact is added in the Siebel application. It presumes that Contact is the parent business component and instantiates the Action business component, destroying it using the Nothing statement after the job is done. For other examples of the Nothing function, read CreateObject Function and GetObject Function.

Sub BusComp_WriteRecord

   Dim oBCact as BusComp
   Set oBCact = theApplication.ActiveBusObject.GetBusComp("Action")

   With oBCact
      .NewRecord NewAfter
      .SetFieldValue "Type", "Event"
      .SetFieldValue "Description", "ADDED THRU SVB"
      .SetFieldValue "Done", Format(Now(),"mm/dd/yyyy hh:mm:ss")
      .SetFieldValue "Status", "Done"
   End With

      set oBCact = Nothing
End Sub

See Also

Is Operator
New Operator

Siebel VB Language Reference