diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-12-02 09:58:11 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-12-03 12:33:53 +0100 |
commit | 4ead3bffc557527e7a146c538773aa4ca6cf84d0 (patch) | |
tree | bb2a25709f125c916e1716d0f76eec23a1a03d48 /source | |
parent | 06b521618b1abac6edb0f7131bce92c887767922 (diff) |
tdf#84675 VBA functions documentation
Plus some addition for Type statement
Change-Id: I9a1aa6a948cd50181fba07c105a25d986b372d02
Reviewed-on: https://gerrit.libreoffice.org/45709
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
(cherry picked from commit 3de74ecadfd9a7529e1b0b05352e42a829d3e279)
Reviewed-on: https://gerrit.libreoffice.org/45737
Diffstat (limited to 'source')
-rw-r--r-- | source/text/sbasic/shared/00000003.xhp | 14 | ||||
-rw-r--r-- | source/text/sbasic/shared/03090400.xhp | 2 | ||||
-rw-r--r-- | source/text/sbasic/shared/03090411.xhp | 4 | ||||
-rw-r--r-- | source/text/sbasic/shared/03090413.xhp | 62 | ||||
-rw-r--r-- | source/text/sbasic/shared/03100000.xhp | 3 | ||||
-rw-r--r-- | source/text/sbasic/shared/03150000.xhp | 140 | ||||
-rw-r--r-- | source/text/sbasic/shared/03150001.xhp | 173 | ||||
-rw-r--r-- | source/text/sbasic/shared/03160000.xhp | 77 | ||||
-rw-r--r-- | source/text/sbasic/shared/03170000.xhp | 71 | ||||
-rw-r--r-- | source/text/sbasic/shared/special_vba_func.xhp | 56 |
10 files changed, 564 insertions, 38 deletions
diff --git a/source/text/sbasic/shared/00000003.xhp b/source/text/sbasic/shared/00000003.xhp index cebb51745f..171d36ad62 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> @@ -189,8 +189,6 @@ <paragraph id="hd_id061420171139089682" role="heading" level="2" xml-lang="en-US"><variable id="functsyntax">Syntax:</variable></paragraph> </section> -<section id="functdefterm"> - <section id="functvalue"> <paragraph id="hd_id061420171139087480" role="heading" level="2" xml-lang="en-US"><variable id="functvalue">Return value:</variable></paragraph> @@ -205,8 +203,12 @@ <paragraph id="hd_id061420171139088233" role="heading" level="2" xml-lang="en-US"><variable id="functexample">Example:</variable></paragraph> </section> -<paragraph id="par_id06142017015837916" role="paragraph" xml-lang="en-US"><variable id="VBA-Financial"><link href="text/sbasic/shared/special_vba_func.xhp">VBA financial functions</link></variable></paragraph> -</section> + +<paragraph id="par_id06142017015837916" role="paragraph" xml-lang="en-US"><variable id="VBA-Financial"><link href="text/sbasic/shared/special_vba_func.xhp#VBAFinancial">VBA financial functions</link></variable></paragraph> +<paragraph id="par_id06142017016837917" role="paragraph" xml-lang="en-US"><variable id="VBATimeAndDate"><link href="text/sbasic/shared/special_vba_func.xhp#VBADateTime">VBA Time and Date functions</link></variable></paragraph> +<paragraph id="par_id06142017016837918" role="paragraph" xml-lang="en-US"><variable id="VBAIO"><link href="text/sbasic/shared/special_vba_func.xhp#VBAIO">VBA I/O functions</link></variable></paragraph> +<paragraph id="par_id06142017016837919" role="paragraph" xml-lang="en-US"><variable id="VBAMath"><link href="text/sbasic/shared/special_vba_func.xhp#VBAMath">VBA Mathematical functions</link></variable></paragraph> +<paragraph id="par_id06142017016837920" role="paragraph" xml-lang="en-US"><variable id="VBAObject"><link href="text/sbasic/shared/special_vba_func.xhp#VBAObject">VBA Object functions</link></variable></paragraph> <section id="errorcode"> @@ -338,4 +340,4 @@ </section> </body> -</helpdocument>
\ No newline at end of file +</helpdocument> diff --git a/source/text/sbasic/shared/03090400.xhp b/source/text/sbasic/shared/03090400.xhp index c420483bb4..02acc326f1 100644 --- a/source/text/sbasic/shared/03090400.xhp +++ b/source/text/sbasic/shared/03090400.xhp @@ -30,8 +30,6 @@ </history> </meta> <body> - - <section id="weitere"> <paragraph id="hd_id3145316" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03090400.xhp" name="Further Statements">Further Statements</link></paragraph> <paragraph role="paragraph" id="par_id3154923" xml-lang="en-US">Statements that do not belong to any of the other runtime categories are described here.</paragraph> diff --git a/source/text/sbasic/shared/03090411.xhp b/source/text/sbasic/shared/03090411.xhp index 6dcf9f92e8..3677118b2b 100644 --- a/source/text/sbasic/shared/03090411.xhp +++ b/source/text/sbasic/shared/03090411.xhp @@ -37,7 +37,9 @@ </section> <paragraph role="heading" id="hd_id3156153" xml-lang="en-US" level="2">Syntax:</paragraph> <bascode> -<paragraph role="bascode" id="par_id3145609" xml-lang="en-US">With Object Statement block End With</paragraph> + <paragraph role="bascode" id="par_id3145609" xml-lang="en-US" localize="false">With Object</paragraph> + <paragraph role="bascode" id="par_id951512205849777" xml-lang="en-US" localize="false"> Statement block</paragraph> + <paragraph role="bascode" id="par_id841512205903256" xml-lang="en-US" localize="false">End With</paragraph> </bascode> <paragraph role="heading" id="hd_id3154924" xml-lang="en-US" level="2">Parameters:</paragraph> <paragraph role="paragraph" id="par_id3147560" xml-lang="en-US">Use <emph>With</emph> and <emph>End With</emph> if you have several properties or methods for a single object.</paragraph> diff --git a/source/text/sbasic/shared/03090413.xhp b/source/text/sbasic/shared/03090413.xhp new file mode 100644 index 0000000000..842f906aaf --- /dev/null +++ b/source/text/sbasic/shared/03090413.xhp @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * 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 . + --> + + <helpdocument version="1.0"> + <meta> + <topic id="textsbasicshared03090413xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">Type Statement [Runtime]</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 [Runtime]">Type Statement [Runtime]</link></paragraph> + <paragraph role="paragraph" id="par_id3159158" xml-lang="en-US">Define non-UNO data structures (structs).</paragraph> + </section> + <paragraph role="paragraph" id="par_id311512206747401" xml-lang="en-US">A struct is an ordered collection of data fields, that can be manipulated as a single item.</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> + <bascode> + <paragraph role="bascode" id="par_id3145609" xml-lang="en-US" localize="false">Type StructName</paragraph> + <paragraph role="bascode" id="par_id951512205849777" xml-lang="en-US" localize="false"> DataField1 As TypeName1</paragraph> + <paragraph role="bascode" id="par_id951512205849778" xml-lang="en-US" localize="false"> DataField2 As TypeName2</paragraph> + <paragraph role="bascode" id="par_id951512205849779" xml-lang="en-US" localize="false"> (...)</paragraph> + <paragraph role="bascode" id="par_id841512205903256" xml-lang="en-US" localize="false">End Type</paragraph> + </bascode> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <bascode> + <paragraph role="bascode" id="par_id761512211077225" xml-lang="en-US" localize="false">REM ***** BASIC *****</paragraph> + <paragraph role="bascode" id="par_id981512211072701" xml-lang="en-US" localize="false">Type customer</paragraph> + <paragraph role="bascode" id="par_id171512211067797" xml-lang="en-US" localize="false"> Name1 As String</paragraph> + <paragraph role="bascode" id="par_id541512211063461" xml-lang="en-US" localize="false"> City As String</paragraph> + <paragraph role="bascode" id="par_id481512211058930" xml-lang="en-US" localize="false">End Type</paragraph> + <paragraph role="bascode" id="par_id841512211054689" xml-lang="en-US" localize="false">Sub setCustomer</paragraph> + <paragraph role="bascode" id="par_id471512211049777" xml-lang="en-US" localize="false"> Dim oCustomer as new customer</paragraph> + <paragraph role="bascode" id="par_id881512211042456" xml-lang="en-US" localize="false"> oCustomer.Name1 = "The Document Foundation"</paragraph> + <paragraph role="bascode" id="par_id461512211038180" xml-lang="en-US" localize="false"> oCustomer.City = "Berlin"</paragraph> + <paragraph role="bascode" id="par_id21512211032617" xml-lang="en-US" localize="false">End Sub</paragraph> + </bascode> + <section id="relatedtopics"> + <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> diff --git a/source/text/sbasic/shared/03100000.xhp b/source/text/sbasic/shared/03100000.xhp index 0c0d2711d4..1c74197489 100644 --- a/source/text/sbasic/shared/03100000.xhp +++ b/source/text/sbasic/shared/03100000.xhp @@ -18,7 +18,7 @@ * 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="textsbasicshared03100000xml" indexer="include" status="PUBLISH"> @@ -59,6 +59,7 @@ <embed href="text/sbasic/shared/03102000.xhp#defvar"/> <embed href="text/sbasic/shared/03102100.xhp#dimtext"/> <embed href="text/sbasic/shared/03102101.xhp#redim"/> +<embed href="text/sbasic/shared/03090413.xhp#type"/> <embed href="text/sbasic/shared/03102200.xhp#isarray"/> <embed href="text/sbasic/shared/03102300.xhp#isdate"/> <embed href="text/sbasic/shared/03102400.xhp#isempty"/> diff --git a/source/text/sbasic/shared/03150000.xhp b/source/text/sbasic/shared/03150000.xhp new file mode 100644 index 0000000000..3b6fa078a2 --- /dev/null +++ b/source/text/sbasic/shared/03150000.xhp @@ -0,0 +1,140 @@ +<?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="textsbasicshared03150000xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">FormatDateTime Function [Runtime - VBA]</title> + <filename>/text/sbasic/shared/03150000.xhp</filename> + </topic> + </meta> + + <body> + + <section id="FormatDateTime"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3150499"> + <bookmark_value>FormatDateTime function</bookmark_value> + </bookmark> + + <paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03150000.xhp" name="FormatDateTime Function [Runtime - VBA]">FormatDateTime Function [Runtime - VBA]</link></paragraph> + <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Applies a date and/or time format to a date expression and returns the result as a string.</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">FormatDateTime (DateExpression as Date [, NamedFormat as Integer])</paragraph> + </bascode> + <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> + <paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">String</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> + <paragraph id="par_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>DateExpression</emph>: The date expression to be formatted.</paragraph> + <paragraph id="par_id24072017011739895" role="paragraph" xml-lang="en-US"><emph>NamedFormat</emph>: An optional <emph>vbDateTimeFormat</emph> enumeration specifying the format that is to be applied to the date and time exression. If omitted, the value <emph>vbGeneralDate</emph> is used.</paragraph> + <paragraph role="heading" id="hd_id811512136434300" level="3" xml-lang="en-US">Date and Time formats (vbDateTimeFormat enumeration)</paragraph> + <table id="tab_0001"> + <tablerow> + <tablecell> + <paragraph role="tablehead" id="par_id201512137337536" xml-lang="en-US">Named Constant</paragraph> + </tablecell> + <tablecell> + <paragraph role="tablehead" id="par_id481512137342798" xml-lang="en-US">Value</paragraph> + </tablecell> + <tablecell> + <paragraph role="tablehead" id="par_id781512137345583" xml-lang="en-US">Description</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph role="tablecontents" id="par_id121512137348477" xml-lang="en-US" localize="false">vbGeneralDate</paragraph> + </tablecell> + <tablecell> + <paragraph role="tablecontents" id="par_id511512137351182" xml-lang="en-US" localize="false">0</paragraph> + </tablecell> + <tablecell> + <paragraph role="tablecontents" id="par_id991512137353869" xml-lang="en-US">Displays a date and/or time as defined in your system's General Date setting. If a date only, no time is displayed; If a time only, no date is displayed.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id181512137579110" role="tablecontents" xml-lang="en-US" localize="false">vbLongDate</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id651512137595327" role="tablecontents" xml-lang="en-US" localize="false">1</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id841512137597989" role="tablecontents" xml-lang="en-US" >Display a date using the long date format specified in your computer's regional settings.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph role="tablecontents" id="par_id391512138077008" xml-lang="en-US" localize="false">vbShortDate</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id651512137594327" role="tablecontents" xml-lang="en-US" localize="false">2</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id841512137397989" role="tablecontents" xml-lang="en-US" >Display a date using the short date format specified in your computer's regional settings.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id181512137679110" role="tablecontents" xml-lang="en-US" localize="false">vbLongTime</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id651512137595227" role="tablecontents" xml-lang="en-US" localize="false">3</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id841512147597989" role="tablecontents" xml-lang="en-US" >Displays a time as defined in your system's Long Time settings.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id183512137579110" role="tablecontents" xml-lang="en-US" localize="false">vbShortTime</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id651512937595327" role="tablecontents" xml-lang="en-US" localize="false">4</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id841517137597989" role="tablecontents" xml-lang="en-US" >Display a time using the 24-hour format (hh:mm).</paragraph> + </tablecell> + </tablerow> + </table> + + <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> + <embed href="text/sbasic/shared/00000003.xhp#err13"/> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <bascode> + <paragraph role="bascode" id="par_id851512148348809" xml-lang="en-US" localize="false">REM ***** BASIC *****</paragraph> + <paragraph role="bascode" id="par_id981512148374491" xml-lang="en-US" localize="false">Option VBASupport 1</paragraph> + <paragraph role="bascode" id="par_id541512148389055" xml-lang="en-US" localize="false">Sub DateFormat</paragraph> + <paragraph role="bascode" id="par_id91512148403780" xml-lang="en-US" localize="false"> Dim d as Date</paragraph> + <paragraph role="bascode" id="par_id551512148424467" xml-lang="en-US" localize="false"> d = ("1958-01-29 00:25")</paragraph> + <paragraph role="bascode" id="par_id541512148446032" xml-lang="en-US"> msgbox("General date format : " & FormatDateTime(d))</paragraph> + <paragraph role="bascode" id="par_id71512148472413" xml-lang="en-US" > msgbox("Long date format : " & FormatDateTime(d,vbLongDate))</paragraph> + <paragraph role="bascode" id="par_id561512148491949" xml-lang="en-US" > msgbox("Short date format : " & FormatDateTime(d,vbShortDate))</paragraph> + <paragraph role="bascode" id="par_id521512148501199" xml-lang="en-US" > msgbox("Long time format : " & FormatDateTime(d,3))</paragraph> + <paragraph role="bascode" id="par_id521512148513930" xml-lang="en-US" > msgbox("Short time format : " & FormatDateTime(d,vbShortTime))</paragraph> + <paragraph role="bascode" id="par_id211512148529064" xml-lang="en-US" localize="false">End Sub</paragraph> + </bascode> + + <section id="relatedtopics"> + <embed href="text/sbasic/shared/00000003.xhp#VBATimeAndDate"/> + </section> +</body> + +</helpdocument> diff --git a/source/text/sbasic/shared/03150001.xhp b/source/text/sbasic/shared/03150001.xhp new file mode 100644 index 0000000000..915e3c8c15 --- /dev/null +++ b/source/text/sbasic/shared/03150001.xhp @@ -0,0 +1,173 @@ +<?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="textsbasicshared03150001xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">WeekdayName Function [Runtime - VBA]</title> + <filename>/text/sbasic/shared/03150001.xhp</filename> + </topic> + </meta> + + <body> + + + <section id="WeekdayName"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3150499"> + <bookmark_value>WeekdayName function</bookmark_value> + </bookmark> + + <paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03150001.xhp" name="WeekdayName Function [Runtime - VBA]">WeekdayName Function [Runtime - VBA]</link></paragraph> + <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">The WeekdayName function returns the weekday name of a specified day of the week.</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">WeekdayName(Weekday as Integer [,Abbreviate as Boolean [,FirstDayofWeek as Integer]])</paragraph> + </bascode> + <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> + <paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">String</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> + <paragraph id="par_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>Weekday</emph>: Value from 1 to 7, Monday to Sunday, whose Week Day Name need to be calculated.</paragraph> + <paragraph id="par_id24072017011739895" role="paragraph" xml-lang="en-US"><emph>Abbreviate</emph>: Optional. A Boolean value that indicates if the weekday name is to be abbreviated.</paragraph> + <paragraph id="par_id240720170117395610" role="paragraph" xml-lang="en-US"><emph>FirstDayofWeek</emph>: Optional. Specifies the first day of the week.</paragraph> + <paragraph role="heading" id="hd_id521512154797683" level="3" xml-lang="en-US">First day of Week:</paragraph> + <table id="tab_id921512153192034"> + <tablerow> + <tablecell> + <paragraph id="par_id921512153192034" role="tablehead" xml-lang="en-US">Named constant</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id611512153251598" role="tablehead" xml-lang="en-US">Value</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id491512153274624" role="tablehead" xml-lang="en-US">Description</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id991512153295301" role="tablecontent" xml-lang="en-US" localize="false">vbUseSystemDayOfWeek</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id571512153316028" role="tablecontent" xml-lang="en-US" localize="false">0</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id611512153338316" role="tablecontent" xml-lang="en-US">Use National Language Support (NLS) API setting</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id291512153514339" role="tablecontent" xml-lang="en-US" localize="false">vbSunday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id791512153569394" role="tablecontents" xml-lang="en-US" localize="false">1</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id151512153594420" role="tablecontents" xml-lang="en-US" >Sunday (default)</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id431512153629070" role="tablecontents" xml-lang="en-US" localize="false">vbMonday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id171512153830709" role="tablecontents" xml-lang="en-US" localize="false">2</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id211512153874765" role="tablecontents" xml-lang="en-US" >Monday</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id1001512153904187" role="tablecontent" xml-lang="en-US" localize="false">vbTuesday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id771512153929215" role="tablecontents" xml-lang="en-US" localize="false">3</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id801512153944376" role="tablecontents" xml-lang="en-US" >Tueday</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id751512153958407" role="tablecontents" xml-lang="en-US" localize="false">vbWednesday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id91512153983659" role="tablecontents" xml-lang="en-US" localize="false">4</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id551512153998501" role="tablecontents" xml-lang="en-US" >Wednesday</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id681512154016128" role="tablecontents" xml-lang="en-US" localize="false">vbThursday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id871512154041210" role="tablecontents" xml-lang="en-US" localize="false">5</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id121512154054207" role="tablecontents" xml-lang="en-US" >Thursday</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id591512154073632" role="tablecontents" xml-lang="en-US" localize="false">vbFriday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id691512154099442" role="tablecontents" xml-lang="en-US" localize="false">6</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id571512154112044" role="tablecontents" xml-lang="en-US" >Friday</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> + <paragraph id="par_id151512154128303" role="tablecontents" xml-lang="en-US" localize="false">vbSaturday</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id831512154158535" role="tablecontents" xml-lang="en-US" localize="false">7</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id541512154172107" role="tablecontents" xml-lang="en-US" >Saturday</paragraph> + </tablecell> + </tablerow> + </table> + + + <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> + <paragraph role="paragraph" id="par_id171512156115581" xml-lang="en-US">None</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <bascode> + <paragraph role="bascode" id="par_id731512155686932" xml-lang="en-US" localize="false">REM ***** BASIC *****</paragraph> + <paragraph role="bascode" id="par_id141512155672881" xml-lang="en-US" localize="false">Option VBASupport 1</paragraph> + <paragraph role="bascode" id="par_id741512155700026" xml-lang="en-US" localize="false">Sub Example_WeekdayName</paragraph> + <paragraph role="bascode" id="par_id321512155714044" xml-lang="en-US" localize="false"> Dim tgf as Integer</paragraph> + <paragraph role="bascode" id="par_id1001512155732764" xml-lang="en-US" localize="false"> tgf = 6</paragraph> + <paragraph role="bascode" id="par_id421512155749762" xml-lang="en-US" localize="false"> print tdf &" "& WeekdayName(tgf,False,vbSunday)</paragraph> + <paragraph role="bascode" id="par_id891512155760344" xml-lang="en-US" localize="false">End Sub</paragraph> + </bascode> + + <section id="relatedtopics"> + + <embed href="text/sbasic/shared/00000003.xhp#VBATimeAndDate"/> + </section> +</body> + +</helpdocument> diff --git a/source/text/sbasic/shared/03160000.xhp b/source/text/sbasic/shared/03160000.xhp new file mode 100644 index 0000000000..834cb58a7b --- /dev/null +++ b/source/text/sbasic/shared/03160000.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="textsbasicshared03160000xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">Input Function [Runtime - VBA]</title> + <filename>/text/sbasic/shared/03160000.xhp</filename> + </topic> + </meta> + + <body> + + + <section id="Input"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3150499"> + <bookmark_value>Input function</bookmark_value> + </bookmark> + + + <paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03160000.xhp" name="Input Function [Runtime - VBA]">Input Function [Runtime - VBA]</link></paragraph> + <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Returns the open stream of an Input or Binary file (String).</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">Input( Number as Integer, [# ] FileNumber as Integer)</paragraph> + </bascode> + <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> + <paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">String</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> + <paragraph id="par_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>Number</emph>: Required. Numeric expression specifying the number of characters to return.</paragraph> + <paragraph id="par_id24072017011739895" role="paragraph" xml-lang="en-US"><emph>#</emph>: Optional.</paragraph> + <paragraph id="par_id240720170117395610" role="paragraph" xml-lang="en-US"><emph>FileNumber</emph>: Required. Any valid file number.</paragraph> + + <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> + <embed href="text/sbasic/shared/00000003.xhp#err6"/> + <embed href="text/sbasic/shared/00000003.xhp#err52"/> + <embed href="text/sbasic/shared/00000003.xhp#err62"/> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <bascode> + <paragraph id="par_id240720170144228912" role="bascode" localize="false" xml-lang="en-US">REM ***** BASIC *****</paragraph> + <paragraph id="par_id240720170144225359" role="bascode" localize="false" xml-lang="en-US">Option VBASupport 1</paragraph> + <paragraph role="bascode" id="par_id371512159801764" xml-lang="en-US" localize="false">Sub Example_Input</paragraph> + <paragraph role="bascode" id="par_id291512159796937" xml-lang="en-US" localize="false"> Dim MyData</paragraph> + <paragraph role="bascode" id="par_id251512159786757" xml-lang="en-US" localize="false"> Open "MyDataFile.txt" For Input As #1</paragraph> + <paragraph role="bascode" id="par_id271512159778620" xml-lang="en-US" localize="false"> Do While Not EOF(1)</paragraph> + <paragraph role="bascode" id="par_id361512159768651" xml-lang="en-US" localize="false"> MyData = Input(1, #1)</paragraph> + <paragraph role="bascode" id="par_id551512159751248" xml-lang="en-US" localize="false"> Print MyData</paragraph> + <paragraph role="bascode" id="par_id321512159745050" xml-lang="en-US" localize="false"> Loop</paragraph> + <paragraph role="bascode" id="par_id61512159730602" xml-lang="en-US" localize="false"> Close #1</paragraph> + <paragraph id="par_id240720170144221275" 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/sbasic/shared/03020202.xhp">Input# statement</link></paragraph> + <embed href="text/sbasic/shared/00000003.xhp#VBAIO"/> + </section> +</body> + +</helpdocument> diff --git a/source/text/sbasic/shared/03170000.xhp b/source/text/sbasic/shared/03170000.xhp new file mode 100644 index 0000000000..f992665c9d --- /dev/null +++ b/source/text/sbasic/shared/03170000.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="textsbasicshared03170000xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">Round Function [Runtime - VBA]</title> + <filename>/text/sbasic/shared/03170000.xhp</filename> + </topic> + </meta> + + <body> + + <section id="Round"> + <bookmark xml-lang="en-US" branch="index" id="bm_id3150499"> + <bookmark_value>Round function</bookmark_value> + </bookmark> + <paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03170000.xhp" name="Round Function [Runtime - VBA]">Round Function [Runtime - VBA]</link></paragraph> + <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">The Round function returns a number rounded to a specified number of digits.</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">Round( expression as Double [,numdecimalplaces as Integer] ) </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_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>expression</emph>: Required. The numeric expression to be rounded.</paragraph> + <paragraph id="par_id240720170117395610" role="paragraph" xml-lang="en-US"><emph>numdecimalplaces</emph>: Optional. Specifies how many places to the right of the decimal are included in the rounding. Default is 0.</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_id240720170144228912" role="bascode" localize="false" xml-lang="en-US">REM ***** BASIC *****</paragraph> + <paragraph id="par_id240720170144225359" role="bascode" localize="false" xml-lang="en-US">Option VBASupport 1</paragraph> + <paragraph role="bascode" id="par_id701512162274019" xml-lang="en-US" localize="false">Sub Example_Round</paragraph> + <paragraph role="bascode" id="par_id501512162266839" xml-lang="en-US" localize="false"> Dim r </paragraph> + <paragraph role="bascode" id="par_id91512162260091" xml-lang="en-US" localize="false"> r = Pi</paragraph> + <paragraph role="bascode" id="par_id571512162254456" xml-lang="en-US" localize="false"> print r ' 3,14159265358979</paragraph> + <paragraph role="bascode" id="par_id831512162245783" xml-lang="en-US" localize="false"> print Round(r, 5) ' 3,14159</paragraph> + <paragraph role="bascode" id="par_id981512162218659" xml-lang="en-US" localize="false"> r = exp(1)</paragraph> + <paragraph role="bascode" id="par_id761512162210883" xml-lang="en-US" localize="false"> print r ' 2,71828182845904</paragraph> + <paragraph role="bascode" id="par_id521512162200022" xml-lang="en-US" localize="false"> print Round(r) ' 3</paragraph> + <paragraph id="par_id240720170144221275" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + </bascode> + + <section id="relatedtopics"> + <paragraph id="par_id061420170153186193" role="paragraph" xml-lang="en-US"><link href="text/scalc/01/04060106.xhp#bm_id3158121">Calc ROUND function</link></paragraph> + <embed href="text/sbasic/shared/00000003.xhp#VBAMath"/> + </section> +</body> + +</helpdocument> diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index a1d6aa105d..42bba51b60 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -30,29 +30,31 @@ <section id="exclusive_vba_functions"> <bookmark xml-lang="en-US" branch="index" id="bm_id051920170350145208"> - <bookmark_value>VBA Functions</bookmark_value> + <bookmark_value>VBA Functions;Introduction</bookmark_value> </bookmark> <paragraph id="hd_id051820170313205718" role="heading" level="1" xml-lang="en-US"><variable id="exclusivevba"><link href="text/sbasic/shared/special_vba_func.xhp">Exclusive VBA functions</link></variable></paragraph> <paragraph id="par_id051820170314436068" role="paragraph" xml-lang="en-US"><ahelp hid=".">%PRODUCTNAME Basic adds this set of functions when VBA support is enabled</ahelp></paragraph> </section> -<paragraph id="hd_id051820170407499827" role="paragraph" xml-lang="en-US">These exclusive VBA functions are enabled when <item type="literal">Option VBASupport 1</item> is the first line of a %PRODUCTNAME Basic module. </paragraph> +<paragraph id="hd_id051820170407499827" role="paragraph" xml-lang="en-US">These exclusive VBA functions are enabled when the statement <item type="literal">Option VBASupport 1</item> is placed before the first macro of a %PRODUCTNAME Basic module. </paragraph> + + +<section id="VBAString"> <bookmark xml-lang="en-US" branch="index" id="bm_id05192017035621676"> <bookmark_value>VBA Functions;Text Functions</bookmark_value> </bookmark> - - <paragraph id="par_id051820170355592834" role="heading" level="2" xml-lang="en-US">Text functions</paragraph> <embed href="text/sbasic/shared/03120111.xhp#ascw"/> <embed href="text/sbasic/shared/03120112.xhp#chrw"/> <embed href="text/sbasic/shared/03120411.xhp#instrrev"/> <embed href="text/sbasic/shared/03120412.xhp#strreverse"/> -<bookmark xml-lang="en-US" branch="index" id="bm_id051920170357078705"> - <bookmark_value>VBA Functions;Financial Functions</bookmark_value> -</bookmark> - +</section> +<section id="VBAFinancial"> + <bookmark xml-lang="en-US" branch="index" id="bm_id051920170357078705"> + <bookmark_value>VBA Functions;Financial Functions</bookmark_value> + </bookmark> <paragraph id="par_id051820170355592581" role="heading" level="2" xml-lang="en-US">Financial functions</paragraph> <embed href="text/sbasic/shared/03140000.xhp#ddb"/> <embed href="text/sbasic/shared/03140001.xhp#fv"/> @@ -67,44 +69,42 @@ <embed href="text/sbasic/shared/03140010.xhp#rate"/> <embed href="text/sbasic/shared/03140011.xhp#sln"/> <embed href="text/sbasic/shared/03140012.xhp#syd"/> +</section> - +<section id="VBADateTime"> +<bookmark xml-lang="en-US" branch="index" id="bm_id051920170358102074"> + <bookmark_value>VBA Functions;Date and Time Functions</bookmark_value> +</bookmark> <paragraph id="par_id051820170356005357" role="heading" level="2" xml-lang="en-US">Date and time functions</paragraph> +<embed href="text/sbasic/shared/03150000.xhp#FormatDateTime"/> +<embed href="text/sbasic/shared/03150001.xhp#WeekdayName"/> +</section> -<list type="unordered"> - <listitem> - <paragraph id="par_id051820170331271717" role="paragraph" localize="false" xml-lang="en-US">FormatDateTime</paragraph> - </listitem> - <listitem> - <paragraph id="par_id051820170335292276" role="paragraph" localize="false" xml-lang="en-US">WeekdayName</paragraph> - </listitem></list> +<section id="VBAIO"> <bookmark xml-lang="en-US" branch="index" id="bm_id051920170358002074"> <bookmark_value>VBA Functions;I/O Functions</bookmark_value> </bookmark> - <paragraph id="par_id051820170356006501" role="heading" level="2" xml-lang="en-US">I/O Functions</paragraph> +<embed href="text/sbasic/shared/03160000.xhp#Input"/> +</section> + +<section id="VBAMath"> -<list type="unordered"> - <listitem> - <paragraph id="par_id05182017033127432" role="paragraph" localize="false" xml-lang="en-US">Input</paragraph> - </listitem></list> <bookmark xml-lang="en-US" branch="index" id="bm_id051920170358346963"> <bookmark_value>VBA Functions;Mathematical Functions</bookmark_value> </bookmark> - <paragraph id="par_id051820170356005221" role="heading" level="2" xml-lang="en-US">Mathematical Functions</paragraph> +<embed href="text/sbasic/shared/03170000.xhp#Round"/> +</section> + +<section id="VBAObject"> -<list type="unordered"> - <listitem> - <paragraph id="par_id051820170335293060" role="paragraph" localize="false" xml-lang="en-US">Round</paragraph> - </listitem></list> <bookmark xml-lang="en-US" branch="index" id="bm_id051920170359045662"> <bookmark_value>VBA Functions;Object Functions</bookmark_value> </bookmark> - <paragraph id="hd_id051920170347039686" role="heading" level="2" xml-lang="en-US">Object Functions</paragraph> <list type="unordered"> @@ -114,6 +114,6 @@ <listitem> <paragraph id="par_id051820170335293856" role="paragraph" localize="false" xml-lang="en-US">RTL</paragraph> </listitem></list> +</section> </body> - </helpdocument> |