summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/shared/03104600.xhp
blob: 891421b506b0164d75c5b8d5b235ed189edef915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->

<meta>
  <topic id="textsbasicshared03104600xml" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">EqualUnoObjects Function</title>
    <filename>/text/sbasic/shared/03104600.xhp</filename>
  </topic>
  <history>
    <created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
  </history>
</meta>

<body>
  <section id="equalunoobjects">
    <bookmark xml-lang="en-US" branch="index" id="bm_id3149205">
      <bookmark_value>EqualUnoObjects function</bookmark_value>
    </bookmark>
    <h1 id="hd_id791633472607429"><variable id="EqualUnoObjects_h1"><link href="text/sbasic/shared/03104600.xhp" name="EqualUnoObjects Function">EqualUnoObjects Function</link></variable></h1>
    <paragraph role="paragraph" id="par_id3145090">Returns <emph>True</emph> if the two specified Basic variables represent the same Uno object instance.</paragraph>
  </section>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id711633530276845">
    <input>EqualUnoObjects(oObj1, oObj2)</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id61633530293311"><emph>oObj1, oObj2:</emph> the variables to be tested.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functvalue"/>
  <paragraph role="paragraph" id="par_id3154285">Bool</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <paragraph role="paragraph" id="par_id771633473462939">The example below returns <emph>True</emph> because both <literal>oDoc</literal> and <literal>ThisComponent</literal> are references to the same object:</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id981633473836933">Dim oDoc as Object</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id941633473837598">oDoc = ThisComponent</paragraph>
    <paragraph role="bascode" localize="false" id="par_id3150541">MsgBox EqualUnoObjects(oDoc, ThisComponent) ' True</paragraph>
  </bascode>
  <paragraph role="paragraph" id="par_id181633473874216">The example below returns <emph>False</emph> because the assignment creates a copy of the original object. Hence <literal>Struct1</literal> and <literal>Struct2</literal> refer to different object instances.</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id441633474052121">Dim Struct1 as new com.sun.star.beans.PropertyValue</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id191633474052633">Dim Struct2 as Variant</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id201633474052866">Struct1.Name = "John"</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id761633474053090">Struct2 = Struct1</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id251633474053313">MsgBox EqualUnoObjects(Struct1, Struct2) ' False</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id441633474053530">Struct2.Name = "Judy"</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id611633474053754">MsgBox Struct1.Name ' John</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id251633474053977">MsgBox Struct2.Name ' Judy</paragraph>
  </bascode>

  <section id="relatedtopics">
    <embed href="text/sbasic/shared/03102800.xhp#IsObject_h1"/>
  </section>
</body>
</helpdocument>