[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text

Olivier Hallot olivier.hallot at libreoffice.org
Mon Jul 24 11:11:55 UTC 2017


 AllLangHelp_sbasic.mk                          |    1 
 source/auxiliary/sbasic.tree                   |    1 
 source/text/sbasic/shared/03140006.xhp         |   77 +++++++++++++++++++++++++
 source/text/sbasic/shared/special_vba_func.xhp |    6 -
 4 files changed, 81 insertions(+), 4 deletions(-)

New commits:
commit 1a5e22fbe576e0c75682b01cbb242b3e29c14d45
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
Date:   Sun Jul 23 23:05:49 2017 -0300

    tdf#108674 Help page for VBA funciton NPV
    
    Change-Id: I7ad2848d559ad15a31cca729587926d99dfd7a60
    Reviewed-on: https://gerrit.libreoffice.org/40348
    Reviewed-by: Olivier Hallot <olivier.hallot at edx.srv.br>
    Tested-by: Olivier Hallot <olivier.hallot at edx.srv.br>

diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk
index 405556ea8..43b6882dd 100644
--- a/AllLangHelp_sbasic.mk
+++ b/AllLangHelp_sbasic.mk
@@ -330,6 +330,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\
     helpcontent2/source/text/sbasic/shared/03140003 \
     helpcontent2/source/text/sbasic/shared/03140004 \
     helpcontent2/source/text/sbasic/shared/03140005 \
+    helpcontent2/source/text/sbasic/shared/03140006 \
     helpcontent2/source/text/sbasic/shared/05060700 \
     helpcontent2/source/text/sbasic/shared/code-stubs \
     helpcontent2/source/text/sbasic/shared/keys \
diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree
index a0085f6a3..0c1cfc882 100644
--- a/source/auxiliary/sbasic.tree
+++ b/source/auxiliary/sbasic.tree
@@ -194,6 +194,7 @@
 <topic id="sbasic/text/sbasic/shared/03060400.xhp">Not-Operator [Runtime]</topic>
 <topic id="sbasic/text/sbasic/shared/03030203.xhp">Now Function [Runtime]</topic>
 <topic id="sbasic/text/sbasic/shared/03140005.xhp">NPer Function [Runtime - VBA]</topic>
+<topic id="sbasic/text/sbasic/shared/03140006.xhp">NPV Function [Runtime - VBA]</topic>
 <topic id="sbasic/text/sbasic/shared/03080000.xhp">Numeric Functions</topic>
 <topic id="sbasic/text/sbasic/shared/03080802.xhp">Oct Function [Runtime]</topic>
 <topic id="sbasic/text/sbasic/shared/03050500.xhp">On Error GoTo ... Resume Statement [Runtime]</topic>
diff --git a/source/text/sbasic/shared/03140006.xhp b/source/text/sbasic/shared/03140006.xhp
new file mode 100644
index 000000000..dc4786464
--- /dev/null
+++ b/source/text/sbasic/shared/03140006.xhp
@@ -0,0 +1,77 @@
+<?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="textsbasicshared03140006xml" indexer="include" status="PUBLISH">
+    <title id="tit" xml-lang="en-US">NPV Function [Runtime - VBA]</title>
+    <filename>/text/sbasic/shared/03140006.xhp</filename>
+  </topic>
+</meta>
+
+<body>
+
+
+<section id="npv">
+<bookmark xml-lang="en-US" branch="index" id="bm_id3150499">
+  <bookmark_value>NPV function</bookmark_value>
+</bookmark>
+
+
+<paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03140006.xhp" name="NPV Function [Runtime - VBA]">NPV Function [Runtime - VBA]</link></paragraph>
+<paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Calculates the Net Present Value of an investment, based on a supplied discount rate, and a series of deposits and withdrawals.</paragraph>
+</section>
+<embed href="text/sbasic/shared/00000003.xhp#vbasupport"/>
+<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+<bascode>
+<paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">NPV (Rate as Double, Values() as Double)</paragraph>
+</bascode>
+<embed href="text/sbasic/shared/00000003.xhp#functvalue"/>
+<paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">Double</paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+<paragraph id="par_id06142017042024114" role="paragraph" xml-lang="en-US"><emph>Rate</emph> is the discount rate for a period.</paragraph>
+<paragraph id="par_id061420170420248911" role="paragraph" xml-lang="en-US"><emph>Values()</emph> is an array that represent deposits (positive values) or withdrawals (negative values).</paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#errorcode"/>
+<embed href="text/sbasic/shared/00000003.xhp#err5"/>
+<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+<bascode>
+<paragraph id="par_id230720172234183296" role="bascode" localize="false" xml-lang="en-US">REM ***** BASIC *****</paragraph>
+<paragraph id="par_id230720172234189989" role="bascode" localize="false" xml-lang="en-US">Option VBASupport 1</paragraph>
+<paragraph id="par_id230720172234184331" role="bascode" localize="false" xml-lang="en-US">Sub ExampleNPV</paragraph>
+<paragraph id="par_id230720172234186787" role="bascode" localize="false" xml-lang="en-US"> Dim r As Double</paragraph>
+<paragraph id="par_id230720172234187720" role="bascode" localize="false" xml-lang="en-US"> Dim pValues(5) as Double</paragraph>
+<paragraph id="par_id230720172234182042" role="bascode" localize="false" xml-lang="en-US"> pValues(0) = 100</paragraph>
+<paragraph id="par_id230720172234187602" role="bascode" localize="false" xml-lang="en-US"> pValues(1) = 100</paragraph>
+<paragraph id="par_id230720172234186650" role="bascode" localize="false" xml-lang="en-US"> pValues(2) = 100</paragraph>
+<paragraph id="par_id230720172234184123" role="bascode" localize="false" xml-lang="en-US"> pValues(3) = -300</paragraph>
+<paragraph id="par_id230720172234182595" role="bascode" localize="false" xml-lang="en-US"> pValues(4) = 100</paragraph>
+<paragraph id="par_id230720172234183081" role="bascode" localize="false" xml-lang="en-US"> pValues(5) = 100</paragraph>
+<paragraph id="par_id230720172234196719" role="bascode" localize="false" xml-lang="en-US"> r = 0.06</paragraph>
+<paragraph id="par_id230720172234195414" role="bascode" localize="false" xml-lang="en-US"> p = NPV( r, pValues)</paragraph>
+<paragraph id="par_id230720172234199811" role="bascode" xml-lang="en-US"> Print p ' returns 174,894967305331</paragraph>
+<paragraph id="par_id230720172234199988" 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/04060119.xhp#bm_id3149242">NPV function in CALC</link></paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#VBA-Financial"/>
+</section>
+</body>
+
+</helpdocument>
diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp
index b87c1adcc..685511912 100644
--- a/source/text/sbasic/shared/special_vba_func.xhp
+++ b/source/text/sbasic/shared/special_vba_func.xhp
@@ -60,12 +60,10 @@
 <embed href="text/sbasic/shared/03140003.xhp#irr"/>
 <embed href="text/sbasic/shared/03140004.xhp#mirr"/>
 <embed href="text/sbasic/shared/03140005.xhp#nper"/>
+<embed href="text/sbasic/shared/03140006.xhp#npv"/>
 
 <list type="unordered">
   <listitem>
-    <paragraph id="par_id051820170335299474" role="paragraph" localize="false" xml-lang="en-US">NPV</paragraph>
-  </listitem>
-  <listitem>
     <paragraph id="par_id051820170335299272" role="paragraph" localize="false" xml-lang="en-US">Pmt</paragraph>
   </listitem>
   <listitem>
@@ -135,4 +133,4 @@
   </listitem></list>
 </body>
 
-</helpdocument>
\ No newline at end of file
+</helpdocument>


More information about the Libreoffice-commits mailing list