Tartalom

# EqualUnoObjects Function

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

### Szintaxis:

EqualUnoObjects(oObj1, oObj2)

### Return type:

Bool (logikai)

### Paraméterek:

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

### Példa:

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

Kapcsolódó témakörök

IsObject Function

UNO Objects, Functions and Services

Támogasson minket!