From 0283e29b71806416024f2ced843ce927e99be7b3 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Wed, 14 Jun 2017 16:02:26 -0300 Subject: tdf#84675 Add help page for DDB function of VBA Change-Id: I769a4f0863ca73db776e3ab1fb7faf1f25f3b2f7 Reviewed-on: https://gerrit.libreoffice.org/38803 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- AllLangHelp_sbasic.mk | 1 + source/text/sbasic/shared/00000003.xhp | 15 ++++-- source/text/sbasic/shared/03140000.xhp | 75 ++++++++++++++++++++++++++ source/text/sbasic/shared/special_vba_func.xhp | 2 +- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 source/text/sbasic/shared/03140000.xhp 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 @@ Information
-You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences +You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences Tools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. 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.
@@ -180,13 +180,20 @@ -
This function is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.
+
+Syntax: +Return value: +Parameters: +Example: +
+
-Error Codes + +Error codes:
@@ -314,4 +321,4 @@
- + \ 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 @@ + + + + + + + DDB Function [Runtime - VBA] + /text/sbasic/shared/03140000.xhp + + + + + + +
+ + DDB function + + + +DDB Function [Runtime - VBA] +Returns the depreciation of an asset for a specified period using the arithmetic-declining method. +
+ + + + +DDB (Cost As Double, Salvage As Double, Life as Double, Period as Double, [Factor as Variant]) + + + +Double + + +Cost fixes the initial cost of an asset. +Salvage fixes the value of an asset at the end of its life. +Life is the number of periods (for example, years or months) defining how long the asset is to be used. +Period states the period for which the value is to be calculated. +Factor (optional) is the factor by which depreciation decreases. If a value is not entered, the default is factor 2. +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. + + + + + +Sub ExampleDDB + Dim ddb_yr1 As Double + ddb_yr1 = DDB(75000,1,60,12,2) + Print ddb_yr1 ' returns 1,721.81 currency units. +End Sub + + +
+DDB function in CALC +VBA financial functions +
+ + +
\ 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 @@ - DDB + DDB FV -- cgit