Funció EqualUnoObjects

Contingut

# EqualUnoObjects Function

Returns True if the two specified Basic variables represent the same Uno object instance.

### Sintaxi:

EqualUnoObjects(oObj1, oObj2)

### Tipus de retorn:

Bool

### Paràmetres:

Name | Type | Descripció
--- | --- | ---
oObj1 | Object | the first Basic Uno object.
oObj2 | Object | the second Basic Uno object.

### Exemple:

The example below returns True because both oDoc and ThisComponent are references to the same object:

        Dim oDoc as Object
        oDoc = ThisComponent
        MsgBox EqualUnoObjects(oDoc, ThisComponent) ' True

The example below returns False because the assignment creates a copy of the original object. Hence Struct1 and Struct2 refer to different object instances.

        Dim Struct1 as new com.sun.star.beans.PropertyValue
        Dim Struct2 as Variant
        Struct1.Name = "John"
        Struct2 = Struct1
        MsgBox EqualUnoObjects(Struct1, Struct2) ' False
        Struct2.Name = "Judy"
        MsgBox Struct1.Name ' John
        MsgBox Struct2.Name ' Judy

Temes relacionats

IsObject Function

Objectes, funcions i serveis de l'UNO

Ens cal la vostra ajuda!