diff options
-rw-r--r-- | AllLangHelp_sbasic.mk | 1 | ||||
-rw-r--r-- | source/auxiliary/sbasic.tree | 1 | ||||
-rw-r--r-- | source/text/sbasic/shared/03090413.xhp | 34 | ||||
-rw-r--r-- | source/text/sbasic/shared/03102800.xhp | 60 | ||||
-rw-r--r-- | source/text/sbasic/shared/03104600.xhp | 76 | ||||
-rw-r--r-- | source/text/sbasic/shared/is_keyword.xhp | 71 |
6 files changed, 168 insertions, 75 deletions
diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index dd4e3ebbe4..75a17ee3a4 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -385,6 +385,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170000 \ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ + helpcontent2/source/text/sbasic/shared/is_keyword \ helpcontent2/source/text/sbasic/shared/calc_functions \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/classmodule \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index f811d03911..73969aca11 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -194,6 +194,7 @@ <topic id="sbasic/text/sbasic/shared/03080502.xhp">Int Function</topic> <topic id="sbasic/text/sbasic/shared/03140002.xhp">IPmt Function [VBA]</topic> <topic id="sbasic/text/sbasic/shared/03140003.xhp">IRR Function [VBA]</topic> + <topic id="sbasic/text/sbasic/shared/is_keyword.xhp">Is Operator</topic> <topic id="sbasic/text/sbasic/shared/03102200.xhp">IsArray Function</topic> <topic id="sbasic/text/sbasic/shared/03102300.xhp">IsDate Function</topic> <topic id="sbasic/text/sbasic/shared/03102400.xhp">IsEmpty Function</topic> diff --git a/source/text/sbasic/shared/03090413.xhp b/source/text/sbasic/shared/03090413.xhp index e7c2329ea5..38c6709ae9 100644 --- a/source/text/sbasic/shared/03090413.xhp +++ b/source/text/sbasic/shared/03090413.xhp @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> - +<helpdocument version="1.0"> <!-- * This file is part of the LibreOffice project. * @@ -18,21 +18,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - <helpdocument version="1.0"> - <meta> - <topic id="textsbasicshared03090413xml" indexer="include" status="PUBLISH"> - <title id="tit" xml-lang="en-US">Type Statement</title> - <filename>/text/sbasic/shared/03090413.xhp</filename> - </topic> - </meta> - <body> - <section id="type"> - <bookmark xml-lang="en-US" branch="index" id="bm_id3153311"> - <bookmark_value>Type statement</bookmark_value> - </bookmark> - <paragraph role="heading" id="hd_id3153311" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03090413.xhp" name="Type Statement">Type Statement</link></paragraph> - <paragraph role="paragraph" id="par_id3159158" xml-lang="en-US">Define non-UNO data structures.</paragraph> - </section> +<meta> + <topic id="textsbasicshared03090413xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">Type Statement</title> + <filename>/text/sbasic/shared/03090413.xhp</filename> + </topic> +</meta> + +<body> + <section id="type"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3153311"> + <bookmark_value>Type statement</bookmark_value> + </bookmark> + <h1 id="hd_id3153311"><variable id="Type_h1"><link href="text/sbasic/shared/03090413.xhp" name="Type Statement">Type Statement</link></variable></h1> + <paragraph role="paragraph" id="par_id3159158" xml-lang="en-US">Define non-UNO data structures.</paragraph> + </section> <paragraph role="paragraph" id="par_id311512206747401" xml-lang="en-US">A Type structure is an ordered collection of data fields, that can be manipulated as a single item.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <paragraph role="paragraph" id="par_id491585753339474"><image src="media/helpimg/sbasic/Type_statement.svg" id="img_id4156296484514"><alt xml-lang="en-US" id="alt_id15152796484514">Type statement diagram</alt></image></paragraph> @@ -66,4 +66,4 @@ <paragraph role="paragraph" id="par_id211512215755793" xml-lang="en-US"><link href="text/sbasic/shared/03132400.xhp" name="CreateObject function">CreateObject function</link></paragraph> </section> </body> -</helpdocument>
\ No newline at end of file +</helpdocument> diff --git a/source/text/sbasic/shared/03102800.xhp b/source/text/sbasic/shared/03102800.xhp index 650992598e..4655ee47f6 100644 --- a/source/text/sbasic/shared/03102800.xhp +++ b/source/text/sbasic/shared/03102800.xhp @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> +<helpdocument version="1.0"> <!-- * This file is part of the LibreOffice project. * @@ -16,35 +17,25 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> -<helpdocument version="1.0"> + <meta> -<topic id="textsbasicshared03102800xml" indexer="include" status="PUBLISH"> -<title id="tit" xml-lang="en-US">IsObject Function</title> -<filename>/text/sbasic/shared/03102800.xhp</filename> -</topic> -<history> -<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created> -</history> + <topic id="textsbasicshared03102800xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">IsObject Function</title> + <filename>/text/sbasic/shared/03102800.xhp</filename> + </topic> + <history> + <created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created> + </history> </meta> <body> -<section id="isobject"> -<bookmark xml-lang="en-US" branch="index" id="bm_id3149346"><bookmark_value>IsObject function</bookmark_value> -</bookmark> -<paragraph role="heading" id="hd_id3149346" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03102800.xhp" name="IsObject Function">IsObject Function</link></paragraph> -<paragraph role="paragraph" id="par_id3148538" xml-lang="en-US">Tests if a variable is an object, as opposed to primitive data types such as dates, numbers, texts. The function returns <literal>True</literal> if the variable is an object, otherwise it returns <literal>False</literal>.</paragraph> -</section> -<paragraph role="heading" id="hd_id3149234" xml-lang="en-US" level="2">Syntax:</paragraph> -<bascode> -<paragraph role="bascode" id="par_id3154285" xml-lang="en-US">IsObject(var)</paragraph> -</bascode> -<paragraph role="heading" id="hd_id3148685" xml-lang="en-US" level="2">Return value:</paragraph> -<paragraph role="paragraph" id="par_id3156024" xml-lang="en-US">Boolean</paragraph> -<paragraph role="heading" id="hd_id3148947" xml-lang="en-US" level="2">Parameters:</paragraph> -<paragraph role="paragraph" id="par_id3148552" xml-lang="en-US"> -<emph>var:</emph> Any variable that you want to test.</paragraph> -<embed href="text/sbasic/shared/00000003.xhp#errorcode"/> -<embed href="text/sbasic/shared/00000003.xhp#err5"/> -<paragraph role="paragraph" id="par_id891575896963115">The following objects return <literal>True</literal>:</paragraph> + <section id="isobject"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3149346"> + <bookmark_value>IsObject function</bookmark_value> + </bookmark> + <h1 id="hd_id51633474369322"><variable id="IsObject_h1"><link href="text/sbasic/shared/03102800.xhp" name="IsObject Function">IsObject Function</link></variable></h1> + <paragraph role="paragraph" id="par_id3148538" xml-lang="en-US">Tests if a variable is an object, as opposed to primitive data types such as dates, numbers, texts. The function returns <literal>True</literal> if the variable is an object, otherwise it returns <literal>False</literal>.</paragraph> + </section> + <paragraph role="paragraph" id="par_id891575896963115">This function returns <literal>True</literal> for the following object types:</paragraph> <list type="unordered"> <listitem><paragraph id="par_id471575892220352" role="listitem"><switchinline select="sys"><caseinline select="WIN">OLE objects or </caseinline></switchinline>UNO objects</paragraph></listitem> <listitem><paragraph id="par_id451575892264518" role="listitem"><link href="text/sbasic/shared/classmodule.xhp" name="Class module">Class module</link> object instances</paragraph></listitem> @@ -53,8 +44,21 @@ <listitem><paragraph id="par_id511575889156356" role="listitem">%PRODUCTNAME Basic modules</paragraph></listitem> </list> <warning id="par_id441575886284392">Data structures return <literal>True</literal> even when empty. Object defined variables return <literal>True</literal> even if uninitialized.</warning> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> + <paragraph role="paragraph" localize="false" id="par_id331633474506248"> + <input>IsObject(var)</input> + </paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> + <paragraph role="paragraph" id="par_id3156024" xml-lang="en-US">Boolean</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> + <paragraph role="paragraph" id="par_id3148552" xml-lang="en-US"> + <emph>var:</emph> The variable to be tested.</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> + <embed href="text/sbasic/shared/00000003.xhp#err5"/> + <section id="relatedtopics"> - <paragraph role="paragraph" id="par_id191575887649871"><link href="text/sbasic/shared/enum.xhp" name="Enum statement">Enum statement</link></paragraph> + <embed href="text/sbasic/shared/03104600.xhp#EqualUnoObjects_h1"/> + <paragraph role="paragraph" id="par_id191575887649871"><link href="text/sbasic/shared/enum.xhp" name="Enum statement">Enum statement</link></paragraph> <embed href="text/sbasic/shared/classmodule.xhp#classmodulestatement"/> <!-- Function statement--> <!-- Object type--> @@ -65,4 +69,4 @@ <paragraph role="paragraph" id="par_id811575887627196"><link href="text/sbasic/shared/01020100.xhp" name="Using variables">Using variables</link></paragraph> </section> </body> -</helpdocument>
\ No newline at end of file +</helpdocument> diff --git a/source/text/sbasic/shared/03104600.xhp b/source/text/sbasic/shared/03104600.xhp index 1339f6bc61..a3bd26262f 100644 --- a/source/text/sbasic/shared/03104600.xhp +++ b/source/text/sbasic/shared/03104600.xhp @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> - +<helpdocument version="1.0"> <!-- * This file is part of the LibreOffice project. * @@ -18,37 +18,53 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> -<helpdocument version="1.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> + <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> -<paragraph role="heading" id="hd_id3149205" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03104600.xhp" name="EqualUnoObjects Function">EqualUnoObjects Function</link></paragraph> -<paragraph role="paragraph" id="par_id3145090" xml-lang="en-US">Returns True if the two specified Basic Uno objects represent the same Uno object instance.</paragraph> -</section> -<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> -<paragraph role="code" localize="false" id="par_id3150669" xml-lang="en-US">EqualUnoObjects( oObj1, oObj2 )</paragraph> -<embed href="text/sbasic/shared/00000003.xhp#functvalue"/> -<paragraph role="paragraph" id="par_id3154285" xml-lang="en-US">Bool</paragraph> -<embed href="text/sbasic/shared/00000003.xhp#functexample"/> -<bascode> - <paragraph role="bascode" id="par_id3156024" xml-lang="en-US">' Copy of objects -> same instance</paragraph> - <paragraph role="bascode" localize="false" id="par_id3154923" xml-lang="en-US">oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" )</paragraph> - <paragraph role="bascode" localize="false" id="par_id3147559" xml-lang="en-US">oIntro2 = oIntrospection</paragraph> - <paragraph role="bascode" localize="false" id="par_id3150541" xml-lang="en-US">print EqualUnoObjects( oIntrospection, oIntro2 )</paragraph> - <paragraph role="bascode" id="par_id3153525" xml-lang="en-US">' Copy of structs as value -> new instance</paragraph> - <paragraph role="bascode" localize="false" id="par_id3154366" xml-lang="en-US">Dim Struct1 as new com.sun.star.beans.Property</paragraph> - <paragraph role="bascode" localize="false" id="par_id3154348" xml-lang="en-US">Struct2 = Struct1</paragraph> - <paragraph role="bascode" localize="false" id="par_id3154125" xml-lang="en-US">print EqualUnoObjects( Struct1, Struct2 )</paragraph> -</bascode> + <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 Struct1 Variant</paragraph> + <paragraph role="bascode" localize="false" id="bas_id201633474052866">a.Name = "John"</paragraph> + <paragraph role="bascode" localize="false" id="bas_id761633474053090">b = a</paragraph> + <paragraph role="bascode" localize="false" id="bas_id251633474053313">MsgBox EqualUnoObjects(Struct1, Struct2) ' False</paragraph> + <paragraph role="bascode" localize="false" id="bas_id441633474053530">b.Name = "Judy"</paragraph> + <paragraph role="bascode" localize="false" id="bas_id611633474053754">MsgBox a.Name ' John</paragraph> + <paragraph role="bascode" localize="false" id="bas_id251633474053977">MsgBox b.Name ' Judy</paragraph> + </bascode> + + <section id="relatedtopics"> + <embed href="text/sbasic/shared/03102800.xhp#IsObject_h1"/> + </section> </body> </helpdocument> diff --git a/source/text/sbasic/shared/is_keyword.xhp b/source/text/sbasic/shared/is_keyword.xhp new file mode 100644 index 0000000000..6501e237c0 --- /dev/null +++ b/source/text/sbasic/shared/is_keyword.xhp @@ -0,0 +1,71 @@ +<?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="iskeywordtopic" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">Is Operator</title> + <filename>/text/sbasic/shared/is_keyword.xhp</filename> + </topic> +</meta> +<body> + <section id="is_keyword_desc"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3149205"> + <bookmark_value>Is Operator</bookmark_value> + </bookmark> + <h1 id="hd_id791633472607429"><variable id="IsOperator_h1"><link href="text/sbasic/shared/is_keyword.xhp" name="Is_Operator">Is Operator</link></variable></h1> + <paragraph role="paragraph" id="par_id3145090">Tests if two Basic variables refer to the same object instance.</paragraph> + </section> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> + <paragraph role="paragraph" localize="false" id="par_id711633530276845"> + <input>result = oObj1 Is oObj2</input> + </paragraph> + <paragraph role="paragraph" id="par_id441633531311929">If <literal>oObj1</literal> and <literal>oObj2</literal> are references to the same object instance, the result will be <emph>True</emph>.</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <paragraph role="paragraph" id="par_id771633473462939">The example below first defines a new type <literal>Student</literal>. Calling <literal>TestObjects</literal> creates the object <literal>oStudent1</literal> as a new object of this type.</paragraph> + <paragraph role="paragraph" id="par_id841633532400710">The assignment <literal>oStudent2 = oStudent1</literal> actually copies the reference to the same object. Hence the result of applying the <literal>Is</literal> operator is <emph>True</emph>.</paragraph> + <bascode> + <paragraph role="bascode" localize="false" id="bas_id981633473836933">Type Student</paragraph> + <paragraph role="bascode" localize="false" id="bas_id941633473837598"> FirstName as String</paragraph> + <paragraph role="bascode" localize="false" id="bas_id941633473837123"> Program as String</paragraph> + <paragraph role="bascode" localize="false" id="bas_id371633532557876">End Type</paragraph> + <paragraph role="bascode" localize="false" id="bas_id301633532616004"></paragraph> + <paragraph role="bascode" localize="false" id="bas_id481633532558146">Sub TestObjects</paragraph> + <paragraph role="bascode" localize="false" id="bas_id471633532558363"> Dim oStudent1 as new Student</paragraph> + <paragraph role="bascode" localize="false" id="bas_id991633532558572"> Dim oStudent2 as Variant</paragraph> + <paragraph role="bascode" localize="false" id="bas_id181633532558771"> oStudent2 = oStudent1</paragraph> + <paragraph role="bascode" localize="false" id="bas_id891633532558970"> MsgBox Student1 Is Student2 ' True</paragraph> + <paragraph role="bascode" localize="false" id="bas_id501633532559284">End Sub</paragraph> + </bascode> + <paragraph role="paragraph" id="par_id181633473874216">The example below returns <emph>False</emph> because <literal>oStudent1</literal> and <literal>oStudent2</literal> are references to two different object instances, each created with the <literal>New</literal> operator.</paragraph> + <bascode> + <paragraph role="bascode" localize="false" id="bas_id941633533047593">Sub TestObjects_v2</paragraph> + <paragraph role="bascode" localize="false" id="bas_id981633533047852"> Dim oStudent1 as new Student</paragraph> + <paragraph role="bascode" localize="false" id="bas_id101633533048041"> Dim oStudent2 as new Student</paragraph> + <paragraph role="bascode" localize="false" id="bas_id821633533048265"> MsgBox oStudent1 Is oStudent2 ' False</paragraph> + <paragraph role="bascode" localize="false" id="bas_id451633533048471">End Sub</paragraph> + </bascode> + + <section id="relatedtopics"> + <embed href="text/sbasic/shared/03104600.xhp#EqualUnoObjects_h1"/> + <embed href="text/sbasic/shared/03102800.xhp#IsObject_h1"/> + <embed href="text/sbasic/shared/03090413.xhp#Type_h1"/> + </section> +</body> +</helpdocument> |