diff options
Diffstat (limited to 'helpcontent2/source/text/sbasic/shared/03104600.xhp')
-rw-r--r-- | helpcontent2/source/text/sbasic/shared/03104600.xhp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/shared/03104600.xhp b/helpcontent2/source/text/sbasic/shared/03104600.xhp new file mode 100644 index 000000000..891421b50 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03104600.xhp @@ -0,0 +1,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> |