summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2017-06-14 16:02:26 -0300
committerOlivier Hallot <olivier.hallot@edx.srv.br>2017-06-14 22:17:52 +0200
commit0283e29b71806416024f2ced843ce927e99be7b3 (patch)
tree9eadd866a7697eadf3e22e463b3525dc44230b2b
parent9f064bef4604e2a8e83a2941869484b924cd52c9 (diff)
tdf#84675 Add help page for DDB function of VBA
Change-Id: I769a4f0863ca73db776e3ab1fb7faf1f25f3b2f7 Reviewed-on: https://gerrit.libreoffice.org/38803 Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br> Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
-rw-r--r--AllLangHelp_sbasic.mk1
-rw-r--r--source/text/sbasic/shared/00000003.xhp15
-rw-r--r--source/text/sbasic/shared/03140000.xhp75
-rw-r--r--source/text/sbasic/shared/special_vba_func.xhp2
4 files changed, 88 insertions, 5 deletions
diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk
index dc1039d08f..8459df924b 100644
--- a/AllLangHelp_sbasic.mk
+++ b/AllLangHelp_sbasic.mk
@@ -324,6 +324,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\
helpcontent2/source/text/sbasic/shared/03132300 \
helpcontent2/source/text/sbasic/shared/03132400 \
helpcontent2/source/text/sbasic/shared/03132500 \
+ helpcontent2/source/text/sbasic/shared/03140000 \
helpcontent2/source/text/sbasic/shared/05060700 \
helpcontent2/source/text/sbasic/shared/code-stubs \
helpcontent2/source/text/sbasic/shared/keys \
diff --git a/source/text/sbasic/shared/00000003.xhp b/source/text/sbasic/shared/00000003.xhp
index 47cd5d06df..aba070e22b 100644
--- a/source/text/sbasic/shared/00000003.xhp
+++ b/source/text/sbasic/shared/00000003.xhp
@@ -31,7 +31,7 @@
<paragraph id="hd_id3148550" role="heading" level="1" xml-lang="en-US">Information</paragraph>
<section id="languageformat">
-<paragraph id="par_id3153381" role="paragraph" xml-lang="en-US">You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in <switchinline select="sys"><caseinline select="MAC"><emph>%PRODUCTNAME - Preferences</emph>
+<paragraph id="par_id3153381" role="paragraph" xml-lang="en-US">You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in <switchinline select="sys"><caseinline select="MAC"><emph>%PRODUCTNAME - Preferences</emph>
</caseinline><defaultinline><emph>Tools - Options</emph></defaultinline></switchinline><emph> - Language Settings - Languages</emph>. In Basic format codes, the decimal point (<emph>.</emph>) is always used as <emph>placeholder</emph> for the decimal separator defined in your locale and will be replaced by the corresponding character.</paragraph>
<paragraph id="par_id3150870" role="paragraph" xml-lang="en-US">The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting.</paragraph>
</section>
@@ -180,13 +180,20 @@
</section>
-
<section id="vbasupport">
<paragraph id="par_id051920171018124524" role="warning" xml-lang="en-US">This function is enabled with the statement <item type="literal">Option VBASupport 1</item> placed before the executable program code in a module.</paragraph>
</section>
+<section id="functdefterm">
+<paragraph id="hd_id061420171139089682" role="paragraph" xml-lang="en-US"><variable id="functsyntax">Syntax:</variable></paragraph>
+<paragraph id="hd_id061420171139087480" role="paragraph" xml-lang="en-US"><variable id="functvalue">Return value:</variable></paragraph>
+<paragraph id="hd_id061420171139084157" role="paragraph" xml-lang="en-US"><variable id="functparameters">Parameters:</variable></paragraph>
+<paragraph id="hd_id061420171139088233" role="paragraph" xml-lang="en-US"><variable id="functexample">Example:</variable></paragraph>
+</section>
+
<section id="errorcode">
-<paragraph id="hd_id3152869" role="heading" level="2" xml-lang="en-US"><variable id="errorcode">Error Codes</variable></paragraph>
+
+<paragraph id="hd_id3152869" role="heading" level="2" xml-lang="en-US"><variable id="errorcode">Error codes:</variable></paragraph>
</section>
<section id="allerrors">
@@ -314,4 +321,4 @@
</section>
</body>
-</helpdocument>
+</helpdocument> \ No newline at end of file
diff --git a/source/text/sbasic/shared/03140000.xhp b/source/text/sbasic/shared/03140000.xhp
new file mode 100644
index 0000000000..97cace90d2
--- /dev/null
+++ b/source/text/sbasic/shared/03140000.xhp
@@ -0,0 +1,75 @@
+<?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="textsbasicshared03140000xml" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">DDB Function [Runtime - VBA]</title>
+ <filename>/text/sbasic/shared/03140000.xhp</filename>
+ </topic>
+</meta>
+
+<body>
+
+
+<section id="ddb">
+<bookmark xml-lang="en-US" branch="index" id="bm_id3150499">
+ <bookmark_value>DDB function</bookmark_value>
+</bookmark>
+
+
+<paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03140000.xhp" name="DDB Function [Runtime - VBA]">DDB Function [Runtime - VBA]</link></paragraph>
+<paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Returns the depreciation of an asset for a specified period using the arithmetic-declining method.</paragraph>
+</section>
+<embed href="text/sbasic/shared/00000003.xhp#vbasupport"/>
+
+<paragraph id="hd_id061420170116474964" role="heading" level="2" xml-lang="en-US"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></paragraph>
+<bascode>
+<paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">DDB (Cost As Double, Salvage As Double, Life as Double, Period as Double, [Factor as Variant])</paragraph>
+</bascode>
+
+<paragraph id="hd_id0614201701254487" role="heading" level="2" xml-lang="en-US"><embedvar href="text/sbasic/shared/00000003.xhp#functvalue"/></paragraph>
+<paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">Double</paragraph>
+
+<paragraph id="hd_id061420170125448913" role="heading" level="2" xml-lang="en-US"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></paragraph>
+<paragraph id="par_id061420170142332738" role="paragraph" xml-lang="en-US"><emph>Cost</emph> fixes the initial cost of an asset.</paragraph>
+<paragraph id="par_id061420170142331999" role="paragraph" xml-lang="en-US"><emph>Salvage</emph> fixes the value of an asset at the end of its life.</paragraph>
+<paragraph id="par_id061420170142338147" role="paragraph" xml-lang="en-US"><emph>Life</emph> is the number of periods (for example, years or months) defining how long the asset is to be used.</paragraph>
+<paragraph id="par_id061420170142338917" role="paragraph" xml-lang="en-US"><emph>Period</emph> states the period for which the value is to be calculated.</paragraph>
+<paragraph id="par_id061420170142335816" role="paragraph" xml-lang="en-US"><emph>Factor</emph> (optional) is the factor by which depreciation decreases. If a value is not entered, the default is factor 2.</paragraph>
+<paragraph id="par_id3145609" role="paragraph" xml-lang="en-US">Use this form of depreciation if you require a higher initial depreciation value as opposed to linear depreciation. The depreciation value gets less with each period and is usually used for assets whose value loss is higher shortly after purchase (for example, vehicles, computers). Please note that the book value will never reach zero under this calculation type.</paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#errorcode"/>
+<embed href="text/sbasic/shared/00000003.xhp#err5"/>
+
+<paragraph id="hd_id061420170125449765" role="heading" level="2" xml-lang="en-US"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></paragraph>
+<bascode>
+<paragraph id="par_id061420170142119551" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDDB</paragraph>
+<paragraph id="par_id061420170142169416" role="bascode" localize="false" xml-lang="en-US"> Dim ddb_yr1 As Double</paragraph>
+<paragraph id="par_id06142017014218316" role="bascode" localize="false" xml-lang="en-US"> ddb_yr1 = DDB(75000,1,60,12,2)</paragraph>
+<paragraph id="par_id061420170142332315" role="bascode" xml-lang="en-US"> Print ddb_yr1 ' returns 1,721.81 currency units. </paragraph>
+<paragraph id="par_id061420170142255740" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
+</bascode>
+
+<section id="relatedtopics">
+<paragraph id="par_id061420170153186192" role="paragraph" xml-lang="en-US"><link href="text/scalc/01/04060103.xhp#bm_id3149998">DDB function in CALC</link></paragraph>
+<paragraph id="par_id06142017015837916" role="paragraph" xml-lang="en-US"><link href="text/sbasic/shared/special_vba_func.xhp">VBA financial functions</link></paragraph>
+</section>
+</body>
+
+</helpdocument> \ No newline at end of file
diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp
index 27598358e8..34296bdd92 100644
--- a/source/text/sbasic/shared/special_vba_func.xhp
+++ b/source/text/sbasic/shared/special_vba_func.xhp
@@ -67,7 +67,7 @@
<list type="unordered">
<listitem>
- <paragraph id="par_id051820170331271603" role="paragraph" localize="false" xml-lang="en-US">DDB</paragraph>
+ <paragraph id="par_id051820170331271603" role="paragraph" localize="false" xml-lang="en-US"><link href="text/sbasic/shared/03140000.xhp">DDB</link></paragraph>
</listitem>
<listitem>
<paragraph id="par_id051820170331278736" role="paragraph" localize="false" xml-lang="en-US">FV</paragraph>