[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |8 source/text/sbasic/shared/03/sf_database.xhp | 34 + source/text/sbasic/shared/03/sf_dataset.xhp | 703 +++ source/text/sbasic/shared/03/sf_toc.xhp | 40 + 6 files changed, 783 insertions(+), 4 deletions(-) New commits: commit cd2824ba5ee24accdeffea3518bd89cc194ed189 Author: Rafael Lima AuthorDate: Wed Nov 29 14:48:04 2023 +0100 Commit: Rafael Lima CommitDate: Fri Dec 1 14:51:21 2023 +0100 Document new SF Dataset service Change-Id: I4e6a792f2cbcbf826f51f5d62e6dad855d4a0bf0 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/160035 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d32336e7a3..8f89b33ffb 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -86,6 +86,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_calc \ helpcontent2/source/text/sbasic/shared/03/sf_chart \ helpcontent2/source/text/sbasic/shared/03/sf_database \ +helpcontent2/source/text/sbasic/shared/03/sf_dataset \ helpcontent2/source/text/sbasic/shared/03/sf_datasheet \ helpcontent2/source/text/sbasic/shared/03/sf_dialog \ helpcontent2/source/text/sbasic/shared/03/sf_dialogcontrol \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 9d02967080..4ae26d4b4b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -356,6 +356,7 @@ Calc service Chart service Database service +Dataset service Datasheet service Dialog service DialogControl service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 7b978e89a5..9076514fae 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -98,14 +98,15 @@ Database + Dataset Datasheet - Document + Document FormDocument - Writer + Writer @@ -179,6 +180,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_database.xhp b/source/text/sbasic/shared/03/sf_database.xhp index 5f8578c242..feaac92aa4 100644 --- a/source/text/sbasic/shared/03/sf_database.xhp +++ b/source/text/sbasic/shared/03/sf_database.xhp @@ -193,18 +193,19 @@ CloseDatabase + CreateDataset DAvg DCount DMin - DMax + DMax DSum DLookup GetRows - OpenFormDocument + OpenFormDocument @@ -239,6 +240,34 @@ + + CreateDataset -- + + Database Service;CreateDataset + +CreateDataset +Creates a Dataset service instance based on a table, query or SQL SELECT statement. + + + db.CreateDataset(sqlcommand: str, opt directsql: bool, opt filter: str, opt orderby: str): svc + + +sqlcommand: A table name, a query name or a valid SQL SELECT statement. Identifiers may be enclosed with square brackets. This argument is case-sensitive. +directsql: Set this argument to True to send the statement directly to the database engine without preprocessing by %PRODUCTNAME (Default = False). +filter: Specifies the condition that records must match to be included in the returned dataset. This argument is expressed as a SQL WHERE statement without the "WHERE" keyword. +orderby: Specifies the ordering of the dataset as a SQL ORDER BY statement without the "ORDER BY" keyword. + +The following examples in Basic and Python return a dataset with the records of a table named "Customers". + + + oDataset = myDatabase.CreateDataset("Customers", Filter := "[Name] LIKE 'A'") + + + + dataset = myDatabase.CreateDataset("Customers", Filter = "[Name] LIKE 'A'") + + + DFunctions --- @@ -514,6 +543,7 @@ + diff --git a/source/text/sbasic/shared/03/sf_dataset.xhp b/source/text/sbasic/shared/03/sf_dataset.xhp new file mode 100644 index 00..82171d2c28 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_dataset.xhp @@ -0,0 +1,703 @@ + + + + + + +SFDatabases.Dataset service +/text/sbasic/shared/03/sf_dataset.xhp +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 source/auxiliary/sbasic.tree |2 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 14 source/text/sbasic/shared/03/sf_toc.xhp | 69 source/text/sbasic/shared/03/sf_toolbar.xhp | 261 source/text/sbasic/shared/03/sf_toolbarbutton.xhp | 345 ++ 6 files changed, 690 insertions(+), 3 deletions(-) New commits: commit 751a65e5be60a35ae970b3a66b2038d90ea580e4 Author: Rafael Lima AuthorDate: Sun Nov 26 17:02:19 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Tue Nov 28 15:45:43 2023 +0100 Document SF Toolbar and ToolbarButton services Change-Id: I57df3b88660198d2432ff73ef1b37025e1b893a3 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/159902 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 8b7719e2b3..d32336e7a3 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -109,6 +109,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_textstream \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/sf_toc \ +helpcontent2/source/text/sbasic/shared/03/sf_toolbar \ +helpcontent2/source/text/sbasic/shared/03/sf_toolbarbutton \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_unittest \ helpcontent2/source/text/sbasic/shared/03/sf_writer \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 8371609dc9..9d02967080 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -376,6 +376,8 @@ String service TextStream service Timer service +Toolbar service +ToolbarButton service UI service UnitTest service Writer service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index af306b184a..7b978e89a5 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -123,13 +123,15 @@ FormControl - Menu + Menu + PopupMenu - PopupMenu - UI + Toolbar + ToolbarButton + UI @@ -237,6 +239,12 @@ + + + + + + diff --git a/source/text/sbasic/shared/03/sf_toc.xhp b/source/text/sbasic/shared/03/sf_toc.xhp index 849cb5829e..8255b37e30 100644 --- a/source/text/sbasic/shared/03/sf_toc.xhp +++ b/source/text/sbasic/shared/03/sf_toc.xhp @@ -925,6 +925,75 @@ + ScriptForge.Toolbar service + + + + + + List of Properties in the Toolbar Service + + + + + +BuiltIn +Docked +HasGlobalScope + + + + +Name +ResourceURL + + + + +Visible +XUIElement + + + + + + + ScriptForge.ToolbarButton service + + + + + + List of Properties in the ToolbarButton Service + + + + + +Caption +Height +Index +OnClick + + + + +Parent +TipText +Visible + + + + +Width +X +Y + + + + + + ScriptForge.UI service diff --git a/source/text/sbasic/shared/03/sf_toolbar.xhp b/source/text/sbasic/shared/03/sf_toolbar.xhp new file mode 100644 index 00..a5e19d6707 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_toolbar.xhp @@ -0,0 +1,261 @@ + + + + + + +SFWidgets.Toolbar service +/text/sbasic/shared/03/sf_toolbar.xhp + + + + + + + Toolbar service + + + + +SFWidgets.Toolbar service +The Toolbar service allows to retrieve information related to the toolbars available for a specific document window. With this service it is possible to: + + +Toggle the visibility of specific toolbars. + + +Access information about the buttons available in each toolbar. + + + + Each %PRODUCTNAME application has its own set of available toolbars. This service handles both built-in and custom toolbars. + The status bar and the menu bar are not considered toolbars in the context of this service. + + Service invocation + Before using the Toolbar service the
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |8 source/text/sbasic/shared/03/sf_base.xhp | 24 +- source/text/sbasic/shared/03/sf_database.xhp | 44 source/text/sbasic/shared/03/sf_document.xhp |4 source/text/sbasic/shared/03/sf_formdocument.xhp | 209 +++ source/text/sbasic/shared/03/sf_toc.xhp |3 8 files changed, 278 insertions(+), 16 deletions(-) New commits: commit 07d0a97995ad6ea6f853e499b187fbe4ab8d4551 Author: Rafael Lima AuthorDate: Sun Aug 20 16:29:07 2023 +0200 Commit: Rafael Lima CommitDate: Fri Aug 25 13:34:33 2023 +0200 Document new SF FormDocument service Change-Id: I6bcf114d25877f5c69463285f9bddcf0c8339079 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/155783 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index a41510f962..8b7719e2b3 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -95,6 +95,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ helpcontent2/source/text/sbasic/shared/03/sf_form \ helpcontent2/source/text/sbasic/shared/03/sf_formcontrol \ +helpcontent2/source/text/sbasic/shared/03/sf_formdocument \ helpcontent2/source/text/sbasic/shared/03/sf_intro \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ helpcontent2/source/text/sbasic/shared/03/sf_menu \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index e97c93b658..8371609dc9 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -365,6 +365,7 @@ FileSystem service Form service FormControl service +FormDocument service L10N service Menu service Platform service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index ca6220be19..af306b184a 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -98,12 +98,13 @@ Database - Datasheet + Datasheet + Document - Document + FormDocument Writer @@ -203,6 +204,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_base.xhp b/source/text/sbasic/shared/03/sf_base.xhp index 9ef4987f76..bbbdf1909f 100644 --- a/source/text/sbasic/shared/03/sf_base.xhp +++ b/source/text/sbasic/shared/03/sf_base.xhp @@ -10,7 +10,7 @@ --> - + SFDocuments.Base service /text/sbasic/shared/03/sf_base.xhp @@ -21,7 +21,7 @@ Base service - SFDocuments.Base service + SFDocuments.Base service The Base service provides a number of methods and properties to facilitate the management and handling of %PRODUCTNAME Base documents. This service is closely related to the Document service, which provides generic methods for handling %PRODUCTNAME documents, including Base documents. Hence, the Base service extends the Document service and provides additional methods that are specific for Base documents, enabling users to: @@ -117,6 +117,7 @@ CloseFormDocument Closes the given form document. Returns True if closure is successful. + The method CloseFormDocument is deprecated since %PRODUCTNAME 7.6. Although it is still available, it may be removed from the Base service in a future release. Use the CloseDocument method from the FormDocument service instead. svc.CloseFormDocument(formdocument: str): bool @@ -183,6 +184,7 @@ A SFDocuments.Form object representing the form specified in the Form argument. + The method Forms is deprecated since %PRODUCTNAME 7.6. Although it is still available, it may be removed from the Base service in a future release. Use the Forms method from the FormDocument service instead. svc.Forms(formdocument: str): str[0..*] @@ -280,11 +282,12 @@ Base service;OpenFormDocument OpenFormDocument - Opens the specified FormDocument either in normal or in design mode. - If the form document is already open, it is activated without changing its mode. The method returns True if the form document could be opened. + Opens the specified FormDocument either in normal or in design mode. This method returns a FormDocument service instance corresponding to the specified form document. + If the form document is already open, it is activated without changing its mode. + If the specified form document does not exist, then Nothing is returned. -svc.OpenFormDocument(formdocument: str,
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03170010.xhp | 19 +--- source/text/sbasic/shared/03170020.xhp | 58 + source/text/sbasic/shared/special_vba_func.xhp |1 5 files changed, 73 insertions(+), 7 deletions(-) New commits: commit 5b8658e58d02f8f3ec6a613f7c4edd32ca2e5d76 Author: Alain Romedenne AuthorDate: Fri Feb 3 13:05:07 2023 + Commit: Olivier Hallot CommitDate: Mon Feb 13 09:57:05 2023 + FormatPercent New Basic function / VBA Change-Id: I0ad4022394632f0d49417bb56ecda641af3b0b42 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/146519 Tested-by: Olivier Hallot Reviewed-by: Olivier Hallot Tested-by: Jenkins diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c864e3d0b9..a41510f962 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -394,6 +394,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/0316 \ helpcontent2/source/text/sbasic/shared/0317 \ helpcontent2/source/text/sbasic/shared/03170010 \ +helpcontent2/source/text/sbasic/shared/03170020 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/is_keyword \ helpcontent2/source/text/sbasic/shared/new_keyword \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 6a97572f6a..e97c93b658 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -165,6 +165,7 @@ Format Function FormatDateTime Function [VBA] FormatNumber Function [VBA] + FormatPercent Function [VBA] Frac Function FreeFile Function FreeLibrary Function diff --git a/source/text/sbasic/shared/03170010.xhp b/source/text/sbasic/shared/03170010.xhp index c2e1a573c6..1f8767b040 100644 --- a/source/text/sbasic/shared/03170010.xhp +++ b/source/text/sbasic/shared/03170010.xhp @@ -21,18 +21,22 @@ FormatNumber function -FormatNumber [VBA] +FormatNumber [VBA] Returns a string with a number formatting applied to a numeric expression. -FormatNumber( expression, numDigitsAfterDecimal as Integer, includeLeadingDigit as Integer, useParensForNegativeNumbers as Integer, groupDigits as Integer ) + +FormatNumber( expression As Variant, [numDigitsAfterDecimal As Integer], [includeLeadingDigit As Integer], _ + [useParensForNegativeNumbers As Integer], [groupDigits As Integer] ) As String + + -String +String -expression: Required. The numeric expression to be formatted. +expression: Required. A numeric expression to be formatted. If expression is a string, then the decimal and thousands separator need to be localized. numDigitsAfterDecimal: Optional. A numeric value specifying the number of digits that should be displayed after the decimal. If omitted, it defaults to the value -1, meaning that the default settings for user interface locale should be used. @@ -46,7 +50,7 @@ vbFalse or 0: Do not display leading zeros. -vbUseDefaults or -2: Use the user interface locale settings. This is the default when omitted. +vbUseDefault or -2: Use the user interface locale settings. This is the default when omitted. useParensForNegativeNumbers: Optional. A vbTriState enumeration value specifying whether negative numbers should be encased in parenthesis. @@ -58,7 +62,7 @@ vbFalse or 0: Do not display parenthesis. -vbUseDefaults or -2: Same as vbFalse. This is the default when omitted. +vbUseDefault or -2: Same as vbFalse. This is the default when omitted. @@ -72,9 +76,10 @@ vbFalse or 0: Do not group digits. -vbUseDefaults or -2: Same as vbFalse. This is the default when omitted. +vbUseDefault or -2: Same as vbFalse. This is the default when omitted. + diff --git a/source/text/sbasic/shared/03170020.xhp b/source/text/sbasic/shared/03170020.xhp new file mode 100644 index 00..ea5d3972e5 --- /dev/null +++ b/source/text/sbasic/shared/03170020.xhp @@ -0,0 +1,58 @@ + + + + + +FormatPercent Function [VBA] +/text/sbasic/shared/03170020.xhp + + + + + + +FormatPercent function + +FormatPercent [VBA] +Returns a string with a number formatting applied to a numeric expression. A percent sign is appended to the returned string. + + + + + FormatPercent( expression, [numDigitsAfterDecimal As Integer],
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/sf_array.xhp | 68 - source/text/sbasic/shared/03/sf_base.xhp |6 source/text/sbasic/shared/03/sf_basic.xhp | 10 source/text/sbasic/shared/03/sf_calc.xhp | 20 source/text/sbasic/shared/03/sf_chart.xhp |8 source/text/sbasic/shared/03/sf_database.xhp | 10 source/text/sbasic/shared/03/sf_datasheet.xhp | 40 source/text/sbasic/shared/03/sf_dialog.xhp| 42 source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 57 - source/text/sbasic/shared/03/sf_dictionary.xhp| 28 source/text/sbasic/shared/03/sf_document.xhp |8 source/text/sbasic/shared/03/sf_exception.xhp | 24 source/text/sbasic/shared/03/sf_filesystem.xhp| 24 source/text/sbasic/shared/03/sf_form.xhp | 24 source/text/sbasic/shared/03/sf_formcontrol.xhp | 42 source/text/sbasic/shared/03/sf_l10n.xhp | 24 source/text/sbasic/shared/03/sf_menu.xhp | 12 source/text/sbasic/shared/03/sf_platform.xhp |6 source/text/sbasic/shared/03/sf_popupmenu.xhp | 18 source/text/sbasic/shared/03/sf_region.xhp| 15 source/text/sbasic/shared/03/sf_session.xhp | 22 source/text/sbasic/shared/03/sf_string.xhp| 24 source/text/sbasic/shared/03/sf_textstream.xhp| 24 source/text/sbasic/shared/03/sf_timer.xhp | 12 source/text/sbasic/shared/03/sf_toc.xhp | 1013 ++ source/text/sbasic/shared/03/sf_ui.xhp| 30 source/text/sbasic/shared/03/sf_unittest.xhp | 18 29 files changed, 1398 insertions(+), 233 deletions(-) New commits: commit bd899b607eed60487a75905a398b751cf5332352 Author: Rafael Lima AuthorDate: Fri Dec 16 15:00:21 2022 + Commit: Olivier Hallot CommitDate: Sat Dec 17 12:02:57 2022 + Create TOC with all ScriptForge methods and properties Change-Id: I32be401689efce0cba70216458bc7c8ba4a405c5 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144309 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 29b4ae9b8e..c864e3d0b9 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -107,6 +107,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_textstream \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ +helpcontent2/source/text/sbasic/shared/03/sf_toc \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_unittest \ helpcontent2/source/text/sbasic/shared/03/sf_writer \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 58ac3fb30d..6a97572f6a 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -346,6 +346,7 @@ Overview of the ScriptForge Library +List of all ScriptForge methods and properties Creating Python Scripts with ScriptForge ScriptForge method signatures Array service diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp index e1fe560429..d1de918774 100644 --- a/source/text/sbasic/shared/03/sf_array.xhp +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -50,38 +50,46 @@ arr = svc.Append(arr, 4) Because Python has built-in list and tuple support, most of the methods in the Array service are available for Basic scripts only. The only exception is ImportFromCSVFile which is supported in both Basic and Python. + -List of Methods in the Array Service + + List of Methods in the Array Service + - - Append - AppendColumn - AppendRow - Contains - ConvertToDictionary - Copy - CountDims - Difference - ExportToTextFile - ExtractColumn - ExtractRow - - - Flatten - ImportFromCSVFile - IndexOf - Insert - InsertSorted - Intersection - Join2D - Prepend - PrependColumn - PrependRow - RangeInit - - + + +Append +AppendColumn +AppendRow +Contains +ConvertToDictionary +Copy +CountDims +Difference +ExportToTextFile +ExtractColumn +ExtractRow + + + + +Flatten +ImportFromCSVFile +IndexOf +Insert +InsertSorted +Intersection +Join2D +Prepend +PrependColumn +PrependRow +RangeInit + + + + Reverse Shuffle Slice @@ -92,9 +100,11 @@ TrimArray Union
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |8 source/text/sbasic/shared/03/sf_base.xhp | 62 ++ source/text/sbasic/shared/03/sf_database.xhp | 106 source/text/sbasic/shared/03/sf_datasheet.xhp| 508 +++ 6 files changed, 668 insertions(+), 18 deletions(-) New commits: commit 63011fa12038ecc796a66fb4fae4851f5b2647c3 Author: Rafael Lima AuthorDate: Thu Dec 15 13:06:45 2022 + Commit: Rafael Lima CommitDate: Fri Dec 16 14:59:41 2022 + Document the new SF_Datasheet service This patch creates the help page for the new ScriptForge service named Datasheet. It also updates associated methods that were added to the Base and Database services. Change-Id: I6611653b77e1ee41f6afacccb2094f19d7178434 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144183 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 42de90dc28..29b4ae9b8e 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -86,6 +86,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_calc \ helpcontent2/source/text/sbasic/shared/03/sf_chart \ helpcontent2/source/text/sbasic/shared/03/sf_database \ +helpcontent2/source/text/sbasic/shared/03/sf_datasheet \ helpcontent2/source/text/sbasic/shared/03/sf_dialog \ helpcontent2/source/text/sbasic/shared/03/sf_dialogcontrol \ helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 43f1b1eabf..58ac3fb30d 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -354,6 +354,7 @@ Calc service Chart service Database service +Datasheet service Dialog service DialogControl service Dictionary service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index c702e46cfa..ca6220be19 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -92,18 +92,19 @@ Base Calc + Chart - Chart Database + Datasheet Document - Writer + Writer @@ -175,6 +176,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_base.xhp b/source/text/sbasic/shared/03/sf_base.xhp index ad5c858204..2fa83cb3ee 100644 --- a/source/text/sbasic/shared/03/sf_base.xhp +++ b/source/text/sbasic/shared/03/sf_base.xhp @@ -88,19 +88,21 @@ CloseFormDocument FormDocuments Forms + GetDatabase - GetDatabase IsLoaded OpenFormDocument + OpenQuery + OpenTable PrintOut - SetPrinter + SetPrinter @@ -304,6 +306,62 @@ + + OpenQuery --- + + Base Service;OpenQuery + +OpenQuery +Opens the Data View window of the specified query and returns an instance of the Datasheet service. +The query can be opened either in normal or design mode. +If the query is already open, its Data View window will be made active. +Closing the Base document will cause the Data View window to be closed as well. + + + svc.OpenQuery(queryname: str, designmode: bool = False): obj + + +queryname: The name of an existing query as a case-sensitive String. +designmode: If this argument is set to True the query is opened in design mode. Otherwise it is opened in normal mode (Default = False). + + + + oDoc.OpenQuery("MyQuery", DesignMode := True) + + + + doc.OpenQuery("MyQuery", designmode=True) + + + + + OpenTable --- + + Base Service;OpenTable + +OpenTable +Opens the Data View window of the specified table and returns an instance of the Datasheet service. +The table can be opened either in normal or design mode. +If the table is already open, its Data View window will be made active. +Closing the Base document will cause the Data View window to be closed as well. + + + svc.OpenTable(tablename:
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/doEvents.xhp | 61 + 3 files changed, 63 insertions(+) New commits: commit cf59121b3e70ffcc53436cb4d1071428d4daa391 Author: Alain Romedenne AuthorDate: Fri Oct 28 19:21:16 2022 +0200 Commit: Alain Romedenne CommitDate: Wed Nov 9 18:12:11 2022 +0100 tdf114263 DoEvents new help page Change-Id: I4a031759aa48df9230e4019740a94ca167519792 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/141920 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index deab5e7f97..42de90dc28 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -406,6 +406,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/CreateUnoSvcWithArgs \ helpcontent2/source/text/sbasic/shared/conventions \ helpcontent2/source/text/sbasic/shared/enum \ +helpcontent2/source/text/sbasic/shared/doEvents \ helpcontent2/source/text/sbasic/shared/ErrVBA \ helpcontent2/source/text/sbasic/shared/fragments \ helpcontent2/source/text/sbasic/shared/partition \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 122ca55363..43f1b1eabf 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -137,6 +137,7 @@ Dim Statement Dir Function Do...Loop Statement + DoEvents Function End Statement Enum Statement [VBA] Environ Function diff --git a/source/text/sbasic/shared/doEvents.xhp b/source/text/sbasic/shared/doEvents.xhp new file mode 100644 index 00..2900c44bf8 --- /dev/null +++ b/source/text/sbasic/shared/doEvents.xhp @@ -0,0 +1,61 @@ + + + + + +DoEvents Function +/text/sbasic/shared/doEvents.xhp + + + + + + +DoEvents function + + +DoEvents Function +Transfers control to the operating system during macro execution, so that it can process the events in waiting. +DoEvents provides compatibility with VBA. It always returns 0. Using it in %PRODUCTNAME is not necessary. + + + +[Call] DoEvents[()] As Integer + + + + Sub DoEventsExample + Dim i As Long, sheet As Object, cell As Object + sheet = ThisComponent.Sheets.getByIndex(0) ' sheet 1 + cell = sheet.getCellByPosition(0,0) ' cell A1 + For i = 1 To 2 + cell.setString(Str(i)) + DoEvents + Next i + End Sub ' DoEventsExample + + + Sub DoEvents_example + Dim i As Long, uiDoc As Object + GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") + Set ui = CreateScriptService("SFDocuments.Calc", ThisComponent) + For i = 1 To 2 + ui.SetValue("A1", i) + DoEvents + Next i + ui.Dispose() + End Sub ' DoEvents_example + + + + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03131600.xhp | 40 +- source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp | 84 + source/text/sbasic/shared/uno_objects.xhp |1 5 files changed, 109 insertions(+), 18 deletions(-) New commits: commit 021a444733a8022967b374642057d2032318634b Author: Alain Romedenne AuthorDate: Fri Oct 28 08:13:23 2022 +0200 Commit: Olivier Hallot CommitDate: Sun Oct 30 14:32:57 2022 +0100 tdf141474 CreateUnoService accepts keyword arguments tdf114263 CreateUnoServiceWithArguments new help page Change-Id: I217746d0817cefcaab7ecb07d30b2c3f2ad8bfff Reviewed-on: https://gerrit.libreoffice.org/c/help/+/141916 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index bf6eb4872c..deab5e7f97 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -403,6 +403,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/Compiler_options \ +helpcontent2/source/text/sbasic/shared/CreateUnoSvcWithArgs \ helpcontent2/source/text/sbasic/shared/conventions \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/ErrVBA \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index a79802e228..122ca55363 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -104,6 +104,7 @@ CreateUnoDialog Function CreateUnoListener Function CreateUnoService Function + CreateUnoServiceWithArguments Function CreateUnoStruct Function CreateUnoValue Function CSng Function diff --git a/source/text/sbasic/shared/03131600.xhp b/source/text/sbasic/shared/03131600.xhp index bf62e3df4c..3e0f978dd8 100644 --- a/source/text/sbasic/shared/03131600.xhp +++ b/source/text/sbasic/shared/03131600.xhp @@ -34,18 +34,20 @@ Instantiates a Uno service with the ProcessServiceManager. - oService = CreateUnoService( UNO service name ) + + CreateUnoService(serviceName As String) As Object + For a list of available services, visit the https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html; name="UNO_Service_Names">com::sun::star Module reference page. The example below creates the function FileExists that uses the service com.sun.star.ucb.SimpleFileAccess to test if a given path is an existing file. -Function FileExists(sPath as String) as Boolean - Dim svcSFA as Object +Function FileExists(sPath as String) As Boolean + Dim svcSFA As Object Set svcSFA = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") - Dim bExists as Boolean : bExists = svcSFA.exists(sPath) - Dim bIsFolder as Boolean : bIsFolder = svcSFA.IsFolder(sPath) + Dim bExists As Boolean : bExists = svcSFA.exists(sPath) + Dim bIsFolder As Boolean : bIsFolder = svcSFA.IsFolder(sPath) FileExists = bExists And Not bIsFolder -End Function +End Function ' FileExists UNO services have an extensive online documentation in the https://api.libreoffice.org/; name="API_Website">api.libreoffice.org website. Visit the https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1ucb_1_1SimpleFileAccess.html; name="SimpleFileAccess_Page">SimpleFileAccess Service reference page to learn more about the methods provided by the service used in the example above. @@ -54,22 +56,24 @@ The following code uses the service com.sun.star.ui.dialogs.FilePicker to show a file open dialog: -Sub Main +Sub Main fName = FileOpenDialog ("Please select a file") Print "file chosen: "+fName -End Sub - -Function FileOpenDialog(title As String) As String -res = com.sun.star.ui.dialogs.ExecutableDialogResults -filepicker = createUnoService("com.sun.star.ui.dialogs.FilePicker") -filepicker.Title = title -If res.OK = filepicker.execute() Then -files = filepicker.getSelectedFiles() -FileOpenDialog=files(0) -EndIf -End Function +End Sub + +Function FileOpenDialog(title As String) As String +res = com.sun.star.ui.dialogs.ExecutableDialogResults + filepicker = createUnoService("com.sun.star.ui.dialogs.FilePicker") + filepicker.Title = title +If res.OK = filepicker.execute() Then + files = filepicker.getSelectedFiles() + FileOpenDialog=files(0) + EndIf +End Function ' Main + + diff --git a/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp b/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp new file mode 100644 index
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree | 10 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_unittest.xhp | 818 +++ 4 files changed, 830 insertions(+), 5 deletions(-) New commits: commit d6e98a37ec8cd0adc8219466555b200bd3b9af8b Author: Rafael Lima AuthorDate: Wed Jun 29 00:02:34 2022 +0200 Commit: Jean-Pierre Ledure CommitDate: Fri Jul 1 16:41:25 2022 +0200 Document the new UnitTest service of the ScriptForge library This patch also updates the sbasic.tree to include the Region and UnitTest services. I also moved the ScriptForge library so that it appears right below the Advanced Basic Libraries (previously it was inside this section). Change-Id: I7dfd9080dcd3212d2b53f88480087d48f5dec60c Reviewed-on: https://gerrit.libreoffice.org/c/help/+/136548 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4114c5a6f..bf6eb4872 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -107,6 +107,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_textstream \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ +helpcontent2/source/text/sbasic/shared/03/sf_unittest \ helpcontent2/source/text/sbasic/shared/03/sf_writer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 3cffcd46f..a79802e22 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -339,7 +339,10 @@ ImportWizard Library Schedule Library ScriptBindingLibrary Library - + Template Library + WikiEditor Library + + Overview of the ScriptForge Library Creating Python Scripts with ScriptForge ScriptForge method signatures @@ -361,17 +364,16 @@ Menu service Platform service PopupMenu service +Region service Services service Session service String service TextStream service Timer service UI service +UnitTest service Writer service - Template Library - WikiEditor Library - Recording a Macro diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 35190c42d..946280ba4 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -146,12 +146,13 @@ Region Services + Session - Session Timer + UnitTest @@ -231,6 +232,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_unittest.xhp b/source/text/sbasic/shared/03/sf_unittest.xhp new file mode 100644 index 0..80ce5c834 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_unittest.xhp @@ -0,0 +1,818 @@ + + + + + +SFUnitTests.UnitTest service +/text/sbasic/shared/03/sf_unittest.xhp + + + + + +UnitTest service + + + + SFUnitTests.UnitTest service + The UnitTest service provides a framework for automating unit tests using the Basic language, including the ability to: + + + Aggregate test cases into test suites and unit tests. + + + Share setup and shutdown code among test cases. + + + Report test results using the Console. + + + + Both the unit tests and the code to be tested must be written in Basic. The code being tested may call functions written in other languages. + The UnitTest service is not available for Python scripts. + + Definitions + Test Case + A test case is the individual unit of testing. It checks for a specific response to a particular set of inputs. + In the UnitTest service, a test case is represented by a single Basic Sub whose name starts with a common prefix (the default is "Test_"). + The test case fails if one of the AssertX methods returns False. + Test Suite + A test suite is a collection of test cases that should be executed together. + All test cases of a test suite are stored in a single Basic module. + A test suite may implement the SetUp and TearDown methods to prepare for test cases in its module. + Unit Test + A full unit test consists of a set of test suites in the same Basic library. + + Service invocation + Before using the UnitTest service the ScriptForge library
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/CallByName.xhp | 122 +++ 3 files changed, 124 insertions(+) New commits: commit 401fb641aff217c7c333ce71d22abcf575d3ed09 Author: Alain Romedenne AuthorDate: Mon Feb 7 16:29:55 2022 +0100 Commit: Rafael Lima CommitDate: Fri Feb 18 01:16:57 2022 +0100 tdf#114263 tdf#141474 tdf#147262 CallByName() function new help page Change-Id: I99ed22b86b04a3ae4338e0c2ab49dbd594032ac6 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/129607 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index e3c220a6e..fa1952c19 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -395,6 +395,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/new_keyword \ helpcontent2/source/text/sbasic/shared/calc_functions \ helpcontent2/source/text/sbasic/shared/code-stubs \ +helpcontent2/source/text/sbasic/shared/CallByName \ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/collection \ helpcontent2/source/text/sbasic/shared/compatible \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index f9a59c2c8..35df2f89b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -69,6 +69,7 @@ BasicLibraries object Beep Statement Blue Function + CallByName Function Case Statement CBool Function CByte Function diff --git a/source/text/sbasic/shared/CallByName.xhp b/source/text/sbasic/shared/CallByName.xhp new file mode 100644 index 0..9a34a1883 --- /dev/null +++ b/source/text/sbasic/shared/CallByName.xhp @@ -0,0 +1,122 @@ + + + + + + +CallByName Function +/text/sbasic/shared/CallByName.xhp + + + + + + +CallByName Function +Invokes a subroutine by its string name. + + + CallByName function + + + + + CallByName(object As Object, ProcName As String, CallType As Integer [,arg0 [,arg1 …]]) + + + + +result: An optional variable that contains the result of the called method or property. + + +object: A Basic module, ClassModule instance or UNO service holding properties or methods. +ProcName: The Function, Sub or Property that is being called. +CallType: The type of performed action such as Get, Let, Method and Set. +arg0, arg1 …: The Function optional parameters given as positional arguments. +Arguments are provided in the exact same order defined in the method signature. Keyword arguments are not possible. + + + Value + CallType Description + + + 1 + Method: Calls a procedure as a function or a subroutine. + + + 2 + Get: Reads a property or variable content. + + + 4 + Let: Assigns a content to a Property or variable. + + + 8 + Set: Assigns a reference value to an Object or Variant variable. + + + + + + +A Calc.Maths module contains a Multiply function expecting a varying list of numbers. + + +ScriptForge.Platform.Architecture information is retrieved. + + +DisplayDirectory property of https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1ui_1_1dialogs_1_1FilePicker-members.html; name="FilePicker">com.sun.star.ui.dialogs.FilePicker UNO service is assigned a value, its content is read twice. + + + + Sub CallByName_example + Const _Method = 1, _Get = 2, _Let = 4, _Set = 8 + + BasicLibraries.loadLibrary("Calc") ' Calc.Maths user library.module + Dim cm As Object : cm = Calc.Maths + MsgBox CallByName(cm, "Multiply", _Method, 3, 45, 1, 89) ' 12015 + MsgBox CallByName(cm, "Multiply", _Method, 1.85e15, 44, 10^8) ' 8.14E+24 + + GlobalScope.BasicLibraries.loadLibrary("ScriptForge") + Dim p As Object : p = CreateScriptService("ScriptForge.Platform") + MsgBox CallByName(p, "Architecture", _Get) ' 32bit/64bit + + Dim uno As Object : uno = CreateUNOService("com.sun.star.ui.dialogs.FilePicker") + CallByName(uno, "DisplayDirectory", _Let, "Libreoffice") + MsgBox CallByName(uno, "DisplayDirectory", _Get) ' "LibreOffice" + var = CallByName(uno, "getDisplayDirectory", _Get) ' "LibreOffice" + End Sub + + +Calc.Maths module + + Option Compatible ' Calc.Maths module + Option Explicit + + Public Function Multiply(ParamArray args() As Double) As Variant + ''' Multiply a variable list of numbers ''' + Dim ndx As Integer : Multiply = 1.0 + If UBound(args) >= 0 Then + For ndx = 0 To UBound(args) + Multiply = Multiply * args(ndx) + Next ndx + End If + End Function 'Calc.Maths.Multiply() + + + + + + + + + + \ No
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree | 23 ++- source/text/sbasic/shared/01020100.xhp | 13 -- source/text/sbasic/shared/0306.xhp | 12 -- source/text/sbasic/shared/0307.xhp | 12 -- source/text/sbasic/shared/03070700.xhp | 64 + source/text/sbasic/shared/03110100.xhp | 55 source/text/sbasic/shared/03120300.xhp | 16 8 files changed, 144 insertions(+), 52 deletions(-) New commits: commit d5322f2e2832fa0567505439dfb1ad0e1af0d578 Author: Alain Romedenne AuthorDate: Thu Jan 20 11:27:46 2022 +0100 Commit: Olivier Hallot CommitDate: Mon Jan 31 14:12:12 2022 +0100 tdf#146847 Integer Division (\) operator help page Change-Id: I90505e2412eb53b3423407af52d6b358801c41f8 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/128543 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 1c921a60d..e3c220a6e 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -208,6 +208,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03070400 \ helpcontent2/source/text/sbasic/shared/03070500 \ helpcontent2/source/text/sbasic/shared/03070600 \ +helpcontent2/source/text/sbasic/shared/03070700 \ helpcontent2/source/text/sbasic/shared/0308 \ helpcontent2/source/text/sbasic/shared/03080100 \ helpcontent2/source/text/sbasic/shared/03080101 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 5f9a653db..f7bc15c49 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -135,7 +135,6 @@ Dim Statement Dir Function Do...Loop Statement - Comparison Operators End Statement Enum Statement [VBA] Environ Function @@ -186,7 +185,7 @@ Hour Function IIf Function If...Then...Else Statement - Imp-Operator + Imp Operator InStr Function InStrRev Function [VBA] Input Function [VBA] @@ -222,14 +221,14 @@ Minute Function MIRR Function [VBA] MkDir Statement - Mod-Operator + Mod Operator Month Function MonthName Function [VBA] MsgBox Function MsgBox Statement Name Statement - New Operator - Not-Operator + New keyword + Not Operator Now Function NPer Function [VBA] NPV Function [VBA] @@ -320,11 +319,15 @@ Write Statement Xor Operator Year Function - "-" Operator - "*" Operator - "+" Operator - "/" Operator - "^" Operator + "-" Subtraction Operator + "*" Multiplication Operator + "+" Addition Operator + "/" Division Operator + "\" Integer Division Operator + "^" Exponentation Operator + " or +" Concatenation Operators + "" Hexadecimal/Octal Notation + ":" Statement Separator Tools Library diff --git a/source/text/sbasic/shared/01020100.xhp b/source/text/sbasic/shared/01020100.xhp index e4c13acce..b552d3db3 100644 --- a/source/text/sbasic/shared/01020100.xhp +++ b/source/text/sbasic/shared/01020100.xhp @@ -36,12 +36,8 @@ values;of variables literals;date literals;integer - literals;hexadecimal literals;integer - literals;octal - literals;h notation - literals;o notation - literals;floating-point + literals;floating point constants arrays;declaring defining;constants @@ -186,6 +182,13 @@ Dim Variable As Date + + ampersand symbol; in literal notation + literals;hexadecimal + literals;octal + literals;h notation + literals;o notation + Literals for Dates Date literals allow to specify unambiguous date variables that are independent from the current language. Literals are enclosed between hash signs #. Possible formats are: diff --git a/source/text/sbasic/shared/0306.xhp b/source/text/sbasic/shared/0306.xhp index 18b196b22..2f67ded5d 100644 --- a/source/text/sbasic/shared/0306.xhp +++ b/source/text/sbasic/shared/0306.xhp @@ -30,12 +30,12 @@ - - + - Logical Operators + Logical Operators The following logical operators are supported by $[officename] Basic. + Logical operators combine (bitwise) the contents of two expressions or variables, for example, to test if specific bits are set or not. @@ -43,5 +43,11 @@ + + + + + + diff --git a/source/text/sbasic/shared/0307.xhp b/source/text/sbasic/shared/0307.xhp index b78baf68a..5b9919cb4 100644 ---
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 41 ++ source/text/sbasic/shared/03/sf_chart.xhp|4 source/text/sbasic/shared/03/sf_document.xhp | 83 + source/text/sbasic/shared/03/sf_menu.xhp | 321 +++ source/text/sbasic/shared/03/sf_popupmenu.xhp| 91 +++--- source/text/sbasic/shared/03/sf_writer.xhp |7 8 files changed, 495 insertions(+), 54 deletions(-) New commits: commit 9de15af089243bac07ce6ea9b7d505163c1b3f78 Author: Rafael Lima AuthorDate: Tue Jan 25 18:43:09 2022 +0100 Commit: Alain Romedenne CommitDate: Fri Jan 28 14:53:20 2022 +0100 Create documentation for SFWidgets.Menu service Change-Id: Iaf0d10c2a1100d78098a99c93a2479d31b0f412b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/128947 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index b474f1396..1c921a60d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -96,6 +96,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_formcontrol \ helpcontent2/source/text/sbasic/shared/03/sf_intro \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ +helpcontent2/source/text/sbasic/shared/03/sf_menu \ helpcontent2/source/text/sbasic/shared/03/sf_methods \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ helpcontent2/source/text/sbasic/shared/03/sf_popupmenu \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 2a0b27123..5f9a653db 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -354,6 +354,7 @@ Form service FormControl service L10N service +Menu service Platform service PopupMenu service Services service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 2d1c640a2..6ef001131 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -58,6 +58,9 @@ + + + @@ -67,14 +70,18 @@ Array Dictionary - Exception + Exception FileSystem + + + + String - TextStream + TextStream @@ -86,13 +93,18 @@ Base Calc - Chart + Chart Database - Document + + + + + Document + Writer @@ -110,8 +122,13 @@ FormControl + Menu + + + + PopupMenu - UI + UI @@ -123,14 +140,18 @@ Basic L10N - Platform + Platform Services + + + + Session - Timer + Timer @@ -180,6 +201,9 @@ + + + @@ -204,6 +228,9 @@ + + + Restricted use for SF_Root, SF_Utils modules as well as internal methods Note: Other ScriptForge undescribed modules are reserved for internal use. Their content is subject to change without notice. diff --git a/source/text/sbasic/shared/03/sf_chart.xhp b/source/text/sbasic/shared/03/sf_chart.xhp index 4e77e41d0..a5f6d22bd 100644 --- a/source/text/sbasic/shared/03/sf_chart.xhp +++ b/source/text/sbasic/shared/03/sf_chart.xhp @@ -10,7 +10,7 @@ --> -ScriptForge.Chart service +SFDocuments.Chart service /text/sbasic/shared/03/sf_chart.xhp @@ -21,7 +21,7 @@ -ScriptForge.Chart service +SFDocuments.Chart service The Chart service provides a set of properties and methods to handle charts in Calc documents. With this service it is possible to: diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp index 2a7f2d084..7bef27181 100644 --- a/source/text/sbasic/shared/03/sf_document.xhp +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -294,12 +294,14 @@ Activate CloseDocument + CreateMenu ExportAsPDF PrintOut + RemoveMenu RunCommand Save @@ -308,7
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree|1 source/text/sbasic/shared/03010300.xhp | 10 +-- source/text/sbasic/shared/03010301.xhp | 15 ++--- source/text/sbasic/shared/03010302.xhp | 12 ++-- source/text/sbasic/shared/03010303.xhp | 15 ++--- source/text/sbasic/shared/03010304.xhp | 10 +-- source/text/sbasic/shared/03010305.xhp | 28 ++--- source/text/sbasic/shared/03010306.xhp | 68 source/text/sbasic/shared/03103350.xhp |4 - source/text/sbasic/shared/compatibilitymode.xhp |5 + 11 files changed, 124 insertions(+), 45 deletions(-) New commits: commit fb0af5ca08c6c9cff2223e641dbd73f9cd2c47c0 Author: Olivier Hallot AuthorDate: Sun Dec 19 13:18:31 2021 -0300 Commit: Olivier Hallot CommitDate: Mon Dec 20 13:10:45 2021 +0100 tdf#145725 VBA mode for RGB functions and warnings + Added a RGB [VBA] page specific to VBA mode for RGB stressing differences + placed warnings on Red vs Blue color interchange in VBA mode + Refactored here and there. Change-Id: I0556babb7c3a4bd3eeff1bfe6993624aa0e78d6d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/127098 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d941abf42..b474f1396 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -123,6 +123,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03010303 \ helpcontent2/source/text/sbasic/shared/03010304 \ helpcontent2/source/text/sbasic/shared/03010305 \ +helpcontent2/source/text/sbasic/shared/03010306 \ helpcontent2/source/text/sbasic/shared/0302 \ helpcontent2/source/text/sbasic/shared/03020100 \ helpcontent2/source/text/sbasic/shared/03020101 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index e6e20b83f..2a0b27123 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -263,6 +263,7 @@ Reset Statement Resume Statement RGB Function + RGB Function [VBA] Right Function RmDir Statement Rnd Function diff --git a/source/text/sbasic/shared/03010300.xhp b/source/text/sbasic/shared/03010300.xhp index 29872415f..ee93251cd 100644 --- a/source/text/sbasic/shared/03010300.xhp +++ b/source/text/sbasic/shared/03010300.xhp @@ -1,6 +1,4 @@ - - - @@ -30,10 +27,10 @@ - - + + - Color Functions + Color Functions This section describes Runtime functions used to define colors. @@ -41,5 +38,6 @@ + diff --git a/source/text/sbasic/shared/03010301.xhp b/source/text/sbasic/shared/03010301.xhp index a56a0e2a3..b5995ab84 100644 --- a/source/text/sbasic/shared/03010301.xhp +++ b/source/text/sbasic/shared/03010301.xhp @@ -27,32 +27,33 @@ - Blue function - -Blue Function +Blue Function Returns the blue component of the specified composite color code. -Syntax: + Blue (Color As Long) -Return value: + Integer -Parameter: + Color value: Long integer expression that specifies any composite color code for which to return the blue component. +Under VBA compatibility mode (Option VBASupport 1), the function Blue() is incompatible with VBA colors, when color from previous call to function RGB [VBA] is passed. + + -Example: + Sub ExampleColor Dim lVar As Long diff --git a/source/text/sbasic/shared/03010302.xhp b/source/text/sbasic/shared/03010302.xhp index aec9e1e10..0b175281f 100644 --- a/source/text/sbasic/shared/03010302.xhp +++ b/source/text/sbasic/shared/03010302.xhp @@ -34,25 +34,25 @@ -Green Function +Green Function Returns the Green component of the given composite color code. -Syntax: + Green (Color As Long) -Return value: + Integer -Parameter: + Color: Long integer expression that specifies a composite color code for which to return the Green component. -Example: + Sub ExampleColor Dim lVar As Long @@ -65,4 +65,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03010303.xhp b/source/text/sbasic/shared/03010303.xhp index d7ac7717a..ddd2b8588 100644 --- a/source/text/sbasic/shared/03010303.xhp +++ b/source/text/sbasic/shared/03010303.xhp @@ -27,27 +27,28 @@ - Red function -Red Function +Red Function Returns the Red component of the specified composite color code. -Syntax: + Red (ColorNumber As Long) -Return value: + Integer -Parameter: + ColorNumber: Long integer expression that specifies any composite color code for which to return the Red component. +Under VBA compatibility mode (Option VBASupport 1), the function Red() is incompatible with VBA colors, when color from previous call
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 10 source/text/sbasic/shared/03/sf_popupmenu.xhp| 330 +++ 4 files changed, 339 insertions(+), 3 deletions(-) New commits: commit 5ce3e1b6c32f59175c76e6dbadb871cba0068262 Author: Rafael Lima AuthorDate: Fri Nov 12 16:34:01 2021 +0200 Commit: Rafael Lima CommitDate: Thu Nov 18 15:30:10 2021 +0100 Create PopupMenu service documentation Change-Id: I511221e68e9504a5c9e5e6c00bb31047a6ccf11b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124982 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index f154d1de6..d941abf42 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -98,6 +98,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ helpcontent2/source/text/sbasic/shared/03/sf_methods \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ +helpcontent2/source/text/sbasic/shared/03/sf_popupmenu \ helpcontent2/source/text/sbasic/shared/03/sf_session \ helpcontent2/source/text/sbasic/shared/03/sf_services \ helpcontent2/source/text/sbasic/shared/03/sf_string \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 562abdbda..7b5675ca2 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -354,6 +354,7 @@ FormControl service L10N service Platform service +PopupMenu service Services service Session service String service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 17cbac0d8..60a102659 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -97,13 +97,14 @@ Dialog DialogControl - UI + Form - Form - FormControl + FormControl + PopupMenu + UI @@ -175,6 +176,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_popupmenu.xhp b/source/text/sbasic/shared/03/sf_popupmenu.xhp new file mode 100644 index 0..7c50ff0ad --- /dev/null +++ b/source/text/sbasic/shared/03/sf_popupmenu.xhp @@ -0,0 +1,330 @@ + + + + + +ScriptForge.PopupMenu service +/text/sbasic/shared/03/sf_popupmenu.xhp + + + + + + PopupMenu service + + + +ScriptForge.PopupMenu service +The PopupMenu service can be used to create popup menus that can be associated with events or executed by scripts. This service provides the following capabilities: + + +Creation of popup menus with custom entries, checkboxes and radio buttons. + + +Decoration of menu items with icons and tooltips. + + + + + Service invocation + + The PopupMenu service can be instantiated in multiple ways. The example below creates a popup menu without associating it with a mouse or application event. + +Sub ShowPopup + GlobalScope.BasicLibraries.loadLibrary("ScriptForge") + Dim myPopup As Object + Set myPopup = CreateScriptService("SFWidgets.PopupMenu", , 300, 300) + myPopup.AddItem("Item ~A") + myPopup.AddItem("Item ~B") + vResponse = myPopup.Execute() +MsgBox("Selected item ID: " vResponse) + myPopup.Dispose() +End Sub + + Running the Sub defined above will create a popup menu with two entries in the position X=300 and Y=300 on the screen. + The prefix SFWidgets can be suppressed while invoking the PopupMenu service. + The following example defines a Sub that can be associated with a mouse event: + +Sub MyPopupClick(Optional poMouseEvent as Object) + Dim myPopup As Object + Set myPopup = CreateScriptService("PopupMenu", poMouseEvent) +' Populate popupmenu with items + Dim vResponse As Variant + vResponse = myPopup.Execute(False) +' Do something based on vResponse + ' ... + myPopup.Dispose() +End Sub + + Use the Dispose method to free resources after executing the popup menu. + It is also possible to associate a popup menu with events triggered by %PRODUCTNAME applications, form and dialog controls. Events such as "Mouse button pressed" and "Mouse button released" are commonly associated with popup menus. + +Sub MyPopupClick(Optional poEvent as Object) + Dim myPopup As Object + Set myPopup =
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |8 source/text/sbasic/shared/03/sf_chart.xhp| 501 +++ 4 files changed, 509 insertions(+), 2 deletions(-) New commits: commit 3445df8b3761cc8dafd0f5a275696ad54dc9bbec Author: Rafael Lima AuthorDate: Wed Oct 27 15:28:42 2021 +0200 Commit: Rafael Lima CommitDate: Fri Oct 29 22:41:46 2021 +0200 Create help page for SF_Chart service Change-Id: Ie244e4416d2b523dfe460701297f6ecfc81f964d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124195 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d1acdf5a4..f154d1de6 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -84,6 +84,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_base \ helpcontent2/source/text/sbasic/shared/03/sf_basic \ helpcontent2/source/text/sbasic/shared/03/sf_calc \ +helpcontent2/source/text/sbasic/shared/03/sf_chart \ helpcontent2/source/text/sbasic/shared/03/sf_database \ helpcontent2/source/text/sbasic/shared/03/sf_dialog \ helpcontent2/source/text/sbasic/shared/03/sf_dialogcontrol \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index cdd7c7ae6..562abdbda 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -342,6 +342,7 @@ Base service Basic service Calc service +Chart service Database service Dialog service DialogControl service diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 466532b1d..17cbac0d8 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -78,13 +78,14 @@ Base - Calc + Calc + Chart Database - Document + Document @@ -138,6 +139,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_chart.xhp b/source/text/sbasic/shared/03/sf_chart.xhp new file mode 100644 index 0..62136eeeb --- /dev/null +++ b/source/text/sbasic/shared/03/sf_chart.xhp @@ -0,0 +1,501 @@ + + + + + +ScriptForge.Chart service +/text/sbasic/shared/03/sf_chart.xhp + + + + + + Chart service + + + +ScriptForge.Chart service +The Chart service provides a set of properties and methods to handle charts in Calc documents. With this service it is possible to: + + +Access chart objects in Calc documents and manipulate their properties. + + +Create and insert new charts into a Calc document. + + +Export charts as image files. + + + + + Chart names + Charts may have two different names: + + +An internal name given by %PRODUCTNAME as soon as the chart object is created (usually "Object 1", "Object 2" and so on). + + +A user-defined name, which can be defined by right-clicking the chart and choosing Name in the context menu. + + + The Chart service primarily uses the user-defined name to access a chart object. If it does not exist, than the internal name is used. + + Service invocation + The Chart service is instantiated from a Calc service instance either using the Charts or CreateChart methods. + + The example below creates a Chart service instance from an existing chart in the current Calc document: + +GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") +Dim oDoc as Object, oChart as Object +Set oDoc = CreateScriptService("Calc") +Set oChart = oDoc.Charts("Sheet1", "Object 1") + + The following example instantiate the Chart service by creating a new chart object based on the data contained in the range "Sheet1.A1:C10". + +Dim oDoc as Object, oChart as Object +Set oDoc = CreateScriptService("Calc") +Set oChart = oDoc.CreateChart("My Chart", "Sheet1", "Sheet1.A1:C10") + + Read the CreateChart method description to learn more about its arguments. + + + The examples above can be written in Python as follows: + +from scriptforge import CreateScriptService +doc = CreateScriptService("Calc") +chart = doc.Charts("Sheet1", "Object 1") + + +doc = CreateScriptService("Calc") +chart = doc.CreateChart("My Chart", "Sheet1", "Sheet1.A1:C10") + + + +Chart service;ChartType +Chart service;Deep +Chart service;Dim3D +Chart service;Exploded +Chart
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/sf_dictionary.xhp |4 source/text/sbasic/shared/03104200.xhp | 57 --- source/text/sbasic/shared/collection.xhp | 189 + 5 files changed, 224 insertions(+), 28 deletions(-) New commits: commit 28499f409af62f1930f427ebf040f9a2cd6422b3 Author: Rafael Lima AuthorDate: Mon Oct 11 19:59:51 2021 +0200 Commit: Rafael Lima CommitDate: Thu Oct 14 19:52:24 2021 +0200 tdf#145067 Document the Basic Collection object Change-Id: I0ea7be144cca78b48ab3dfd07426ad679b07b26b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123398 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index dfc04180f..d1acdf5a4 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -391,6 +391,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/calc_functions \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/classmodule \ +helpcontent2/source/text/sbasic/shared/collection \ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/Compiler_options \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index cde86c221..cdd7c7ae6 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -96,6 +96,7 @@ Chr Function ChrW Function [VBA] Close Statement +Collection Object Const Statement ConvertFromURL Function ConvertToURL Function diff --git a/source/text/sbasic/shared/03/sf_dictionary.xhp b/source/text/sbasic/shared/03/sf_dictionary.xhp index bce0c86ea..c05c13d90 100644 --- a/source/text/sbasic/shared/03/sf_dictionary.xhp +++ b/source/text/sbasic/shared/03/sf_dictionary.xhp @@ -31,8 +31,7 @@ Keys and items can be retrieved, counted, updated, and much more. - %PRODUCTNAME Basic Collection object does not support the retrieval of the keys. - Additionally its items contain only primitive Basic data types such as dates, text, numbers, and the like. + The Dictionary service is similar to the built-in %PRODUCTNAME Basic Collection object, however with more features. For example, Collection objects do not support the retrieval of keys. Moreover, Dictionaries provide additional capabilities as replacing keys, testing if a specific key already exists and converting the Dictionary into an Array object or JSON string. Service invocation @@ -518,6 +517,7 @@ + diff --git a/source/text/sbasic/shared/03104200.xhp b/source/text/sbasic/shared/03104200.xhp index 056478400..ffe9b526a 100644 --- a/source/text/sbasic/shared/03104200.xhp +++ b/source/text/sbasic/shared/03104200.xhp @@ -1,5 +1,5 @@ - + - - -Array Function -/text/sbasic/shared/03104200.xhp - - -Sun Microsystems, Inc. - + +Array Function +/text/sbasic/shared/03104200.xhp + + +Sun Microsystems, Inc. + - -Array function - -Array Function -Returns the type Variant with a data field. - - - -Array ( Argument list) - -See also DimArray - - -Argument list: A list of any number of arguments that are separated by commas. - - + + + Array function + +Array Function +Returns the type Variant with a data field. + + + +Array ( Argument list) + + See also DimArray + + + Argument list: A list of any number of arguments that are separated by commas. + + Dim A As Variant A = Array("Fred","Tom","Bill") Msgbox A(2) - + + + + + + diff --git a/source/text/sbasic/shared/collection.xhp b/source/text/sbasic/shared/collection.xhp new file mode 100644 index 0..5fb1d79eb --- /dev/null +++ b/source/text/sbasic/shared/collection.xhp @@ -0,0 +1,189 @@ + + + + + + +Collection Object +/text/sbasic/shared/collection.xhp + + + + + + Collection Object + Collection;Count + +Collection Object +Collections can be used to store items of different types. Each item can be accessed by its index or by an optional key associated with it. + + A Collection object has the following methods: + + +Add: inserts a new item into the collection. Optionally a string value can be defined as the key to the item. + + +Count: returns the number of items in the collection. + + +Item: returns the item in the collection by passing its index or key. + + +Remove: removes the specified item from the collection by its index or key. + + + Items in a Collection can be accessed
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03102100.xhp|5 + source/text/sbasic/shared/03103700.xhp|4 + source/text/sbasic/shared/03132400.xhp| 53 +++- source/text/sbasic/shared/new_keyword.xhp | 77 ++ 6 files changed, 116 insertions(+), 25 deletions(-) New commits: commit 152530c4360c80e9a052c4c883a8e4d53001f364 Author: Rafael Lima AuthorDate: Thu Oct 7 20:12:41 2021 +0200 Commit: Olivier Hallot CommitDate: Mon Oct 11 02:05:24 2021 +0200 Create documentation for Basic "New" operator Change-Id: I11157f8db43811a107eb5270db5b39c351b37dcc Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123159 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 367bf03c8..dfc04180f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -387,6 +387,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/is_keyword \ +helpcontent2/source/text/sbasic/shared/new_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 5202b9087..cde86c221 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -227,6 +227,7 @@ MsgBox Function MsgBox Statement Name Statement +New Operator Not-Operator Now Function NPer Function [VBA] diff --git a/source/text/sbasic/shared/03102100.xhp b/source/text/sbasic/shared/03102100.xhp index 8413c080e..a992f4527 100644 --- a/source/text/sbasic/shared/03102100.xhp +++ b/source/text/sbasic/shared/03102100.xhp @@ -153,6 +153,9 @@ Next i End Sub - + + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03103700.xhp b/source/text/sbasic/shared/03103700.xhp index 8203a58d5..45f6ce0e0 100644 --- a/source/text/sbasic/shared/03103700.xhp +++ b/source/text/sbasic/shared/03103700.xhp @@ -30,7 +30,6 @@ Set statement - New keyword Nothing object @@ -69,5 +68,8 @@ New creates UNO objects or class module objects, before assigning it to a variable. + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03132400.xhp b/source/text/sbasic/shared/03132400.xhp index 32c3b0573..665fe359d 100644 --- a/source/text/sbasic/shared/03132400.xhp +++ b/source/text/sbasic/shared/03132400.xhp @@ -24,29 +24,36 @@ /text/sbasic/shared/03132400.xhp - - - - CreateObject function - -CreateObject Function -Creates a UNO object. On Windows, can also create OLE objects.see i70942 -This method creates instances of the type that is passed as parameter. - - -oObj = CreateObject( type ) - - -Type address -Name1 As String -City As String -End Type - -Sub main -myaddress = CreateObject("address") -MsgBox IsObject(myaddress) -End Sub - + + + CreateObject function + +CreateObject Function +Creates a UNO object. On Windows, can also create OLE objects.see i70942 +This method creates instances of the type that is passed as parameter. + + + +oObj = CreateObject(type) + + + type: the type of the object to be created, as a string. + + +Type address + Name1 As String +City As String +End Type + +Sub main + myaddress = CreateObject("address") + MsgBox IsObject(myaddress) +End Sub + + + + + diff --git a/source/text/sbasic/shared/new_keyword.xhp b/source/text/sbasic/shared/new_keyword.xhp new file mode 100644 index 0..95d2ccff8 --- /dev/null +++ b/source/text/sbasic/shared/new_keyword.xhp @@ -0,0 +1,77 @@ + + + + + + +New Operator +/text/sbasic/shared/new_keyword.xhp + + + + + + New Operator + +New Operator +Use the New operator to instantiate objects of user-defined types, as well as Uno services, structs and enumerations. + + + +Dim oObj as New ObjectType + + +oObj = New ObjectType + + The New operator can be used either during variable declaration or in an assignment operation. + + The following example uses the New operator to create an instance of the PropertyValue Uno struct. + +' Instantiating the object during variable declaration +Dim oProp1 as New com.sun.star.beans.PropertyValue +oProp1.Name = "Some name" +oProp1.Value = 100 +' The same can be accomplished with an assignment +Dim oProp2 as Object +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/auxiliary/scalc.tree|4 source/text/sbasic/guide/read_write_values.xhp | 196 + 4 files changed, 201 insertions(+), 1 deletion(-) New commits: commit 7f942a62c3e173d25ec8e3d7ee786b2087d49e42 Author: Rafael Lima AuthorDate: Sun Oct 3 15:25:22 2021 +0200 Commit: Rafael Lima CommitDate: Thu Oct 7 21:28:32 2021 +0200 Create a guide on Calc macros on reading and writing cell values This patch also creates a new entry in the Calc tree menu to store all pages about Calc macros. Currently there are only two, but in future patches new pages will be added. Change-Id: Iac55c87d1159f4163ba3150e83160b4156d0d0f6 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122936 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 75a17ee3a..367bf03c8 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -23,6 +23,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/guide/control_properties \ helpcontent2/source/text/sbasic/guide/create_dialog \ helpcontent2/source/text/sbasic/guide/insert_control \ +helpcontent2/source/text/sbasic/guide/read_write_values \ helpcontent2/source/text/sbasic/guide/sample_code \ helpcontent2/source/text/sbasic/guide/show_dialog \ helpcontent2/source/text/sbasic/guide/translation \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 73969aca1..5202b9087 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -377,7 +377,6 @@ Event-Driven Macros %PRODUCTNAME Basic Programming Examples Calling Python Scripts from Basic -Formatting Borders in Calc with Macros Access2Base, the API for Base users diff --git a/source/auxiliary/scalc.tree b/source/auxiliary/scalc.tree index 4705fdff0..10af79f09 100644 --- a/source/auxiliary/scalc.tree +++ b/source/auxiliary/scalc.tree @@ -188,6 +188,10 @@ Protecting Cells from Changes Unprotecting Cells + + +Reading and Writing values to Ranges +Formatting Borders in Calc with Macros Deactivating Automatic Changes diff --git a/source/text/sbasic/guide/read_write_values.xhp b/source/text/sbasic/guide/read_write_values.xhp new file mode 100644 index 0..b8dab321c --- /dev/null +++ b/source/text/sbasic/guide/read_write_values.xhp @@ -0,0 +1,196 @@ + + + + + + +Reading and Writing values to Ranges +/text/sbasic/guide/read_write_values.xhp + + + + + +macros;read values from cells +macros;write values to cells + + Reading and Writing values to Ranges + Macros in %PRODUCTNAME Calc often need to read and write values from/to sheets. This help page describes the various approaches to accessing sheets and ranges to read or write their values. + All examples presented in this page can be implemented both in Basic and Python. + + Accessing a Single Cell + The example below enters the numeric value 123 into cell "A1" of the current sheet. + +Dim oSheet as Object +Dim oCell as Object +oSheet = ThisComponent.CurrentController.getActiveSheet() +oCell = oSheet.getCellRangeByName("A1") +oCell.setValue(123) + + The same can be accomplished with Python: + +doc = XSCRIPTCONTEXT.getDocument() +sheet = doc.getCurrentController().getActiveSheet() +cell = sheet.getCellRangeByName("A1") +cell.setValue(123) + + Note that in the previous examples the cell is accessed using its range name "A1". It is also possible to access cells using indices as though the sheet were a matrix where columns and rows are indexed starting from zero. + This can be done using the getCellByPosition(colIndex, rowIndex) method, that takes in a column and a row index. The example below in Basic changes the text value in cell "C1" (column 2, row 0). + +oSheet = ThisComponent.CurrentController.getActiveSheet() +oCell = oSheet.getCellByPosition(2, 0) +oCell.setString("Hello") + + This example can also be implemented in Python as follows: + +doc = XSCRIPTCONTEXT.getDocument() +sheet = doc.getCurrentController().getActiveSheet() +cell = sheet.getCellByPosition(2, 0) +cell.setString("Hello") + + The main difference between Python and Basic scripts lies on how to get access to the sheet object by using the XSCRIPTCONTEXT context variable. After that, all methods and properties are identical in Basic and Python. + Values, Strings and Formulas + Calc cells can have three types of values: numeric, strings and formulas. Each type has its own set and get methods: + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03090413.xhp | 34 ++--- source/text/sbasic/shared/03102800.xhp | 60 +--- source/text/sbasic/shared/03104600.xhp | 76 ++- source/text/sbasic/shared/is_keyword.xhp | 71 6 files changed, 168 insertions(+), 75 deletions(-) New commits: commit 82e70eb6efa88c3d21606292a042cd6978385480 Author: Rafael Lima AuthorDate: Wed Oct 6 16:17:39 2021 +0200 Commit: Rafael Lima CommitDate: Thu Oct 7 19:37:03 2021 +0200 tdf#143687 Document the "IS" Basic keyword This patch also improves related help pages about the functions IsObject and EqualUnoObjects. Change-Id: I5f16596ed057c1104d5fa2650299861741bd7b2e Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123153 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index dd4e3ebbe..75a17ee3a 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/0317 \ 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 f811d0391..73969aca1 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -194,6 +194,7 @@ Int Function IPmt Function [VBA] IRR Function [VBA] +Is Operator IsArray Function IsDate Function IsEmpty Function diff --git a/source/text/sbasic/shared/03090413.xhp b/source/text/sbasic/shared/03090413.xhp index e7c2329ea..38c6709ae 100644 --- a/source/text/sbasic/shared/03090413.xhp +++ b/source/text/sbasic/shared/03090413.xhp @@ -1,5 +1,5 @@ - + - - - - Type Statement - /text/sbasic/shared/03090413.xhp - - - - - - Type statement - - Type Statement - Define non-UNO data structures. - + + +Type Statement +/text/sbasic/shared/03090413.xhp + + + + + + + Type statement + +Type Statement +Define non-UNO data structures. + A Type structure is an ordered collection of data fields, that can be manipulated as a single item. Type statement diagram @@ -66,4 +66,4 @@ CreateObject function - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03102800.xhp b/source/text/sbasic/shared/03102800.xhp index 650992598..4655ee47f 100644 --- a/source/text/sbasic/shared/03102800.xhp +++ b/source/text/sbasic/shared/03102800.xhp @@ -1,4 +1,5 @@ + - + - -IsObject Function -/text/sbasic/shared/03102800.xhp - - -Sun Microsystems, Inc. - + +IsObject Function +/text/sbasic/shared/03102800.xhp + + +Sun Microsystems, Inc. + - -IsObject function - -IsObject Function -Tests if a variable is an object, as opposed to primitive data types such as dates, numbers, texts. The function returns True if the variable is an object, otherwise it returns False. - -Syntax: - -IsObject(var) - -Return value: -Boolean -Parameters: - -var: Any variable that you want to test. - - -The following objects return True: + + + IsObject function + +IsObject Function +Tests if a variable is an object, as opposed to primitive data types such as dates, numbers, texts. The function returns True if the variable is an object, otherwise it returns False. + + This function returns True for the following object types: OLE objects or UNO objects Class module object instances @@ -53,8 +44,21 @@ %PRODUCTNAME Basic modules Data structures return True even when empty. Object defined variables return True even if uninitialized. + + +IsObject(var) + + + Boolean + + + var: The variable to be tested. + + + - Enum statement + +Enum statement @@ -65,4 +69,4 @@ Using variables - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03104600.xhp b/source/text/sbasic/shared/03104600.xhp index 1339f6bc6..a3bd26262 100644 --- a/source/text/sbasic/shared/03104600.xhp +++ b/source/text/sbasic/shared/03104600.xhp @@ -1,5 +1,5 @@ - + - - -EqualUnoObjects Function -/text/sbasic/shared/03104600.xhp - - -Sun Microsystems, Inc. - + +EqualUnoObjects Function +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03/avail_release.xhp |3 source/text/sbasic/shared/03/sf_document.xhp | 43 - source/text/sbasic/shared/03/sf_writer.xhp | 184 + 5 files changed, 189 insertions(+), 43 deletions(-) New commits: commit 62f7c4a827756af6d7cbc838a7d663ad5d962b04 Author: Alain Romedenne AuthorDate: Thu Sep 9 17:10:28 2021 +0200 Commit: Alain Romedenne CommitDate: Mon Sep 27 16:56:32 2021 +0200 SFDocuments.Writer new service - WiP Change-Id: Ia3da307c224aaea53d6a0e2067a78db113119b50 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/121770 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index dc978fef3..dd4e3ebbe 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -102,6 +102,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_textstream \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ +helpcontent2/source/text/sbasic/shared/03/sf_writer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ helpcontent2/source/text/sbasic/shared/03/lib_wikieditor \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 3902268c6..f811d0391 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -356,6 +356,7 @@ TextStream service Timer service UI service +Writer service Template Library WikiEditor Library diff --git a/source/text/sbasic/shared/03/avail_release.xhp b/source/text/sbasic/shared/03/avail_release.xhp index b61ecaf4e..019363a95 100644 --- a/source/text/sbasic/shared/03/avail_release.xhp +++ b/source/text/sbasic/shared/03/avail_release.xhp @@ -20,6 +20,9 @@ This method is not available in Python. This property is not available in Python. Tags for LibreOffice 7.3 + +This service is available from %PRODUCTNAME 7.3 onwards. + This method is available from %PRODUCTNAME 7.3 onwards. diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp index 8b0257a4a..c4e0bafd2 100644 --- a/source/text/sbasic/shared/03/sf_document.xhp +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -294,7 +294,6 @@ Activate CloseDocument - Forms @@ -369,48 +368,6 @@ - - Forms - - -Document service;Forms - - Forms - Depending on the parameters provided this method will return: - - -A zero-based Array (or a tuple in Python) with the names of all the forms contained in the document (if the form argument is absent) - - -A SFDocuments.Form service instance representing the form specified as argument. - - - This method is applicable only for Writer documents. Calc and Base documents have their own Forms method in the Calc and Base services, respectively. - - -svc.Forms(): str[0..*] - - -svc.Forms(form: str = ''): svc - - - svc.Forms(form: int): svc - - - form: The name or index corresponding to a form stored in the document. If this argument is absent, the method will return a list with the names of all forms available in the document. - - In the following examples, the first line gets the names of all forms in the document and the second line retrieves the Form object of the form named "Form_A". - - -Set FormNames = oDoc.Forms() -Set FormA = oDoc.Forms("Form_A") - - - -form_names = doc.Forms() -form_A = doc.Forms("Form_A") - - - RunCommand --- diff --git a/source/text/sbasic/shared/03/sf_writer.xhp b/source/text/sbasic/shared/03/sf_writer.xhp new file mode 100644 index 0..5b29bf5d0 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_writer.xhp @@ -0,0 +1,184 @@ + + + + + + +SFDocuments.Writer service +/text/sbasic/shared/03/sf_writer.xhp + + + + + + + Writer service + + + + +SFDocuments.Writer service +The SFDocuments shared library provides a number of methods and properties to facilitate the management and handling of %PRODUCTNAME documents. +Some methods are generic for all types of documents and are inherited from the SF_Document module, whereas other methods that are specific for Writer documents are defined in the SF_Writer module. +The SF_Writer
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/guide/calc_borders.xhp | 248 ++ 3 files changed, 250 insertions(+) New commits: commit 9b8c44b49d1f732e51673804c28a8b606596630b Author: Rafael Lima AuthorDate: Fri Sep 3 17:01:52 2021 +0200 Commit: Olivier Hallot CommitDate: Fri Sep 3 17:50:08 2021 +0200 Create guide about Calc macros to format cell borders This patch is a follow-up to a previous revert: https://gerrit.libreoffice.org/c/help/+/121554 This patch uses the correct path for the new file "calc_borders.xhp". Change-Id: I4eb72db1ef8f5d964905be46dcb645dbd4e28e67 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/121556 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index fc3aca51c..dc978fef3 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -19,6 +19,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/guide/access2base \ helpcontent2/source/text/sbasic/guide/basic_2_python \ helpcontent2/source/text/sbasic/guide/basic_examples \ +helpcontent2/source/text/sbasic/guide/calc_borders \ helpcontent2/source/text/sbasic/guide/control_properties \ helpcontent2/source/text/sbasic/guide/create_dialog \ helpcontent2/source/text/sbasic/guide/insert_control \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 9256c75d0..3902268c6 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -375,6 +375,7 @@ Event-Driven Macros %PRODUCTNAME Basic Programming Examples Calling Python Scripts from Basic +Formatting Borders in Calc with Macros Access2Base, the API for Base users diff --git a/source/text/sbasic/guide/calc_borders.xhp b/source/text/sbasic/guide/calc_borders.xhp new file mode 100644 index 0..6ca63b619 --- /dev/null +++ b/source/text/sbasic/guide/calc_borders.xhp @@ -0,0 +1,248 @@ + + + + + + +Formatting Borders in Calc with Macros +/text/sbasic/guide/calc_borders.xhp + + + + + +macros;format borders + + Formatting Borders in Calc with Macros + By using Basic or Python programming languages it is possible to write macros that apply formats to ranges of cells in Calc. + + Formatting Borders in Ranges of Cells + The code snippet below creates a Sub called FormatCellBorder that applies new border formats to a given range address in the current Calc sheet. + +Sub FormatCellBorder(cellAddress as String, newStyle as Byte, newWidth as Long, Optional newColor as Long) +' Creates the UNO struct that will store the new line format + Dim lineFormat as New com.sun.star.table.BorderLine2 + lineFormat.LineStyle = newStyle + lineFormat.LineWidth = newWidth + If Not IsMissing(newColor) Then lineFormat.Color = newColor +' Gets the target cell + Dim oCell as Object + Set oCell = ThisComponent.CurrentController.ActiveSheet.getCellRangeByName(cellAddress) +' Applies the new format to all borders + oCell.TopBorder = lineFormat + oCell.RightBorder = lineFormat + oCell.LeftBorder = lineFormat + oCell.BottomBorder = lineFormat +End Sub + + The Sub described above takes in four arguments: + + +cellAddress is a string such as denoting the range to be formatted in the format "A1". + + +newStyle is an integer value that corresponds to the border line style (see Line Styles below). + + +newWidth is an integer value that defines the line width. + + +newColor is an integer value corresponding to a color defined using the RGB function. + + + To call FormatCellBorder create a new macro and pass the desired arguments, as shown below: + +Sub MyMacro +' Gives access to the line style constants + Dim cStyle as Object + Set cStyle = com.sun.star.table.BorderLineStyle +' Formats "B5" with solid blue borders + FormatCellBorder("B5", cStyle.SOLID, 20, RGB(0, 0, 255)) +' Formats all borders in the range "D2:F6" with red dotted borders + FormatCellBorder("D2:F6", cStyle.DOTTED, 20, RGB(255, 0, 0)) +End Sub + + It is possible to implement the same functionality in Python: + +from uno import createUnoStruct +from scriptforge import CreateScriptService + +def formatCellBorder(cellAddress, newStyle, newWidth, newColor=0): +# Defines the new line format + line_format = createUnoStruct("com.sun.star.table.BorderLine2") + line_format.LineStyle = newStyle + line_format.LineWidth = newWidth + line_format.Color = newColor +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree|1 source/text/sbasic/shared/03/sf_methods.xhp | 196 source/text/sbasic/shared/conventions.xhp |4 4 files changed, 202 insertions(+) New commits: commit ff452e27c1c7f420d8a0cf8a9d82d1d318225d46 Author: Alain Romedenne AuthorDate: Fri Jun 11 14:22:57 2021 +0200 Commit: Rafael Lima CommitDate: Mon Jun 21 19:32:01 2021 +0200 ScriptForge method signatures Change-Id: I5c29d5c08a8c5bd46ca45dc1d17449a0ae4789b8 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116910 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d50105a59..fc3aca51c 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -93,6 +93,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_formcontrol \ helpcontent2/source/text/sbasic/shared/03/sf_intro \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ +helpcontent2/source/text/sbasic/shared/03/sf_methods \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ helpcontent2/source/text/sbasic/shared/03/sf_session \ helpcontent2/source/text/sbasic/shared/03/sf_services \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index e8a0dca19..52dcb35a4 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -334,6 +334,7 @@ Overview of the ScriptForge Library Creating Python Scripts with ScriptForge +ScriptForge method signatures Array service Base service Basic service diff --git a/source/text/sbasic/shared/03/sf_methods.xhp b/source/text/sbasic/shared/03/sf_methods.xhp new file mode 100644 index 0..0d91cedbd --- /dev/null +++ b/source/text/sbasic/shared/03/sf_methods.xhp @@ -0,0 +1,196 @@ + + + + + +ScriptForge Method Signatures +/text/sbasic/shared/03/sf_methods.xhp + + + +ScriptForge Method Signatures + +ScriptForge; Method signatures + +ScriptForge libraries aggregate macro scripting resources for %PRODUCTNAME to be invoked from Basic macros or Python scripts. Its modules and classes are invoked from user scripts as "Services" that expose properties, methods and events. + + + Whenever service methods are proposed solely for %PRODUCTNAME Basic, their syntax presentation matches that of Basic subroutines, functions or properties. + + + Whenever service methods are proposed for Python and Basic, or solely for Python, their syntax and arguments use a specific textual layout. + + + +Basic only service method +Typographical characters such as brackets, ellipsis or curly braces denote optional, repetitive or compulsory arguments: + + + + FSO.HashFile(FileName As String, _ + Algorithm As String = {MD5|SHA1|SHA224|SHA256|SHA384|SHA512}) As String + SF_Array.ImportFromCSVFile(FileName As String, _ + [Delimiter = ","], [DateFormat As String]) As Variant + SF_String.SplitNotQuoted(InputStr As String, _ + [Delimiter As String], [Occurrences As Long], [QuoteChar As String]) As Variant + + +Python or Basic service methods +The following typographical rules are mixing the UML notation, the API documentation layout and the UNO object inspector user interface: + + +Optional parameters are indicated with either opt, '=' accompanying a default value, or '[ ]' brackets. + + +arguments are lowercased, in order to comply with Python PEP 8 while Basic is case-agnostic. + + +Collections arguments or API sequences are denoted using UML multiplicity. That applies also to return values. + + +Basic data types and Python annotations are syntactically transposed as: + + + + + + %PRODUCTNAMEBasic + + + Syntax + + + Python + + + + + Boolean + + + bool + + + bool + + + + + Date + + + datetime + + + datetime + + + + + Double + + + float + + + float + + + + + Integer + + + int + + + int + + + + + Long + + + int + + + int + + + + + Object + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 + source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03132200.xhp| 24 - source/text/sbasic/shared/thisdbdoc.xhp | 52 ++ source/text/sbasic/shared/uno_objects.xhp | 21 5 files changed, 91 insertions(+), 9 deletions(-) New commits: commit 9fffc3e09d2cddfc614e5520d8d33942572dd5a5 Author: Alain Romedenne AuthorDate: Wed Jun 2 13:58:29 2021 +0200 Commit: Rafael Lima CommitDate: Wed Jun 9 16:49:57 2021 +0200 ThisDatabaseDocument new help page Change-Id: I9ad35913bbc5fef9208b3a9ea5eb9be01f882131 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116463 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index f40dd2d0f..c2d750049 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -396,6 +396,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/replace \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ +helpcontent2/source/text/sbasic/shared/stardesktop \ +helpcontent2/source/text/sbasic/shared/thisdbdoc \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index b52b277ee..9d981d88c 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -294,6 +294,7 @@ SYD Function [VBA] Tan Function ThisComponent object +ThisDatabaseDocument object TimeSerial Function TimeValue Function Time Function diff --git a/source/text/sbasic/shared/03132200.xhp b/source/text/sbasic/shared/03132200.xhp index eb96a9964..b89a5d3cb 100644 --- a/source/text/sbasic/shared/03132200.xhp +++ b/source/text/sbasic/shared/03132200.xhp @@ -29,11 +29,18 @@ ThisComponent object components;addressing -ThisComponent Object -Addresses the active component whose properties can be read and set, and whose methods can be called. ThisComponent is used in Basic, where it represents the current document. Properties and methods available through ThisComponent depend on the document type.see i60932 + +ThisComponent Object +ThisComponent represents the current document in Basic macros. It addresses the active component whose properties can be read and set, and whose methods can be called. Properties and methods available through ThisComponent depend on the document type.see i60932 + -ThisComponent + + ThisComponent + +When the active window is a Base form, query, report, table or view, ThisComponent returns the current Form information. +When active window is the Basic IDE, ThisComponent object returns the component owning the current script. + Sub Main @@ -45,5 +52,16 @@ index.update() End Sub + + + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1TextDocument.html; name="TextDocument API service">com.sun.star.text.TextDocument API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1sheet_1_1SpreadsheetDocument.html; name="SpreadsheetDocument API service">com.sun.star.sheet.SpreadsheetDocument API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1presentation_1_1PresentationDocument.html; name="PresentationDocument API service">com.sun.star.presentation.PresentationDocument API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1drawing_1_1DrawingDocument.html; name="DrawingDocument API service">com.sun.star.drawing.DrawingDocument API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1formula_1_1FormulaProperties.html; name="FormulaProperties API service">com.sun.star.formula.FormulaProperties API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1sdb_1_1OfficeDatabaseDocument.html; name="OfficeDatabaseDocument API service">com.sun.star.sdb.OfficeDatabaseDocument API service + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1document_1_1OfficeDocument.html; name="OfficeDocument API service">com.sun.star.document.OfficeDocument API service + + \ No newline at end of file diff --git a/source/text/sbasic/shared/thisdbdoc.xhp b/source/text/sbasic/shared/thisdbdoc.xhp new file mode 100644 index 0..8f4a1c61c --- /dev/null +++ b/source/text/sbasic/shared/thisdbdoc.xhp @@ -0,0 +1,52 @@ + + + + + +ThisDatabaseDocument object +/text/sbasic/shared/thisdbdoc.xhp + + + + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/special_vba_func.xhp | 51 +++ source/text/sbasic/shared/strconv.xhp | 179 + 4 files changed, 203 insertions(+), 29 deletions(-) New commits: commit 68a8e252d2600cabc694d9c489ec641dbd3c902a Author: Olivier Hallot AuthorDate: Fri Jun 4 00:18:32 2021 -0300 Commit: Olivier Hallot CommitDate: Mon Jun 7 19:36:15 2021 +0200 tdf#124066 Help for VBA StrConv function 1) LCID codes linked to LibreOffice internal LCID file 2) Examples borrowed from QA tests Change-Id: I1b00a1901f32de0243b518de39abd633ba08eadc Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116684 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 0f7e60542..f40dd2d0f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -402,6 +402,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/main0601 \ helpcontent2/source/text/sbasic/shared/Resume \ helpcontent2/source/text/sbasic/shared/special_vba_func \ +helpcontent2/source/text/sbasic/shared/strconv \ helpcontent2/source/text/sbasic/shared/vbasupport \ helpcontent2/source/text/sbasic/python/main \ helpcontent2/source/text/sbasic/python/python_2_basic \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 40d7c6bf2..b52b277ee 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -285,6 +285,7 @@ Static keyword Stop Statement StrComp Function +StrConv Function [VBA] Str Function StrReverse Function [VBA] String Function diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index 32d98942e..8a257ee26 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -26,23 +26,20 @@ - - - VBA Functions;Introduction +VBA Functions;Introduction - -Exclusive VBA Functions and Statements +Exclusive VBA Functions and Statements %PRODUCTNAME Basic adds this set of functions when VBA support is enabled. These exclusive VBA functions are enabled when the statement Option VBASupport 1 is placed before the first macro of a %PRODUCTNAME Basic module. - -VBA Statements - + +VBA Statements + VBA Statements @@ -51,20 +48,21 @@ - VBA Functions;Text Functions +VBA Functions;Text Functions -Text functions +Text functions + - -VBA Functions;Financial Functions - -Financial functions + +VBA Functions;Financial Functions + +Financial functions @@ -82,9 +80,9 @@ -VBA Functions;Date and Time Functions +VBA Functions;Date and Time Functions -Date and time functions +Date and time functions @@ -92,36 +90,31 @@ - VBA Functions;I/O Functions +VBA Functions;I/O Functions -I/O Functions +I/O Functions - VBA Functions;Mathematical Functions - VBA Functions;formatting numbers - VBA Functions;partitioning numbers +VBA Functions;Mathematical Functions +VBA Functions;formatting numbers +VBA Functions;partitioning numbers - -Mathematical Functions +Mathematical Functions - - - VBA Functions;Object Properties and Methods +VBA Functions;Object Properties and Methods - -Object Properties and Methods +Object Properties and Methods - diff --git a/source/text/sbasic/shared/strconv.xhp b/source/text/sbasic/shared/strconv.xhp new file mode 100644 index 0..81267e187 --- /dev/null +++ b/source/text/sbasic/shared/strconv.xhp @@ -0,0 +1,179 @@ + + + + + +StrConv Function [VBA] +/text/sbasic/shared/strconv.xhp + + + + +StrConv function + + +StrConv Function +Convert a string as specified by a conversion type. + + + +StrConv(Text, Conversion, [ LCID ]) + +String + +Text: Any valid string expression. +Conversion: The type of conversion to perform, as defined in the table below. + + + +Conversion + + +Value + + +Description + + + + +vbUpperCase + + +1 + + +Converts Text characters to uppercase. + + + + +vbLowerCase + + +2 + + +Converts Text characters lowercase. + + + + +vbProperCase + + +3 + + +Converts the first letter of every word in Text to uppercase. + + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree | 19 +++ source/text/sbasic/shared/0300.xhp |2 - source/text/sbasic/shared/0311.xhp | 41 - 4 files changed, 10 insertions(+), 53 deletions(-) New commits: commit f44cc1049db06a92f8ca790eb90d5609437e5eb7 Author: Alain Romedenne AuthorDate: Wed Mar 31 17:35:51 2021 +0200 Commit: Olivier Hallot CommitDate: Thu Apr 1 19:43:52 2021 +0200 BASIC Toc cleanup Relocated topics are - Generating random numbers - (deletion) Comparison operators - Numeric functions - Trigonometric functions - Further statements Change-Id: I2ed75e20f790273460be56fab62ad6cc6e357397 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113366 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 0b2633a92..c1bae31bb 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -301,7 +301,6 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03104500 \ helpcontent2/source/text/sbasic/shared/03104600 \ helpcontent2/source/text/sbasic/shared/03104700 \ -helpcontent2/source/text/sbasic/shared/0311 \ helpcontent2/source/text/sbasic/shared/03110100 \ helpcontent2/source/text/sbasic/shared/0312 \ helpcontent2/source/text/sbasic/shared/03120100 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index fdd05f76f..0f1d4cbd4 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -38,7 +38,7 @@ Using Procedures and Functions Libraries, Modules and Dialogs How to Read Syntax Diagrams - + Screen I/O Functions File I/O Functions Date and Time Functions @@ -46,19 +46,22 @@ Logical Operators Mathematical Operators Numeric Functions +Trigonometric Functions +Generating Random Numbers Controlling Program Execution +Further Statements Variables Basic Constants -Comparison Operators +Comparison Operators Strings UNO Objects, Functions and Services Calling Calc functions Exclusive VBA functions Other Commands - + Abs Function -AND Operator +And Operator Array Function Asc Function AscW Function [VBA] @@ -93,7 +96,6 @@ Chr Function ChrW Function [VBA] Close Statement -Comparison Operators Const Statement ConvertFromURL Function ConvertToURL Function @@ -164,9 +166,7 @@ FreeFile Function FreeLibrary Function Function Statement -Further Statements FV Function [VBA] -Generating Random Numbers GetAttr Function GetDefaultContext Function GetGUIType Function @@ -241,7 +241,7 @@ Option Explicit Statement Option VBASupport Statement Optional (in Function Statement) -Or-Operator +Or Operator Partition Function [VBA] Pmt Function [VBA] PPmt Function [VBA] @@ -297,7 +297,6 @@ TimeValue Function Time Function Timer Function -Trigonometric Functions Trim Function TwipsPerPixelX Function TwipsPerPixelY Function @@ -313,7 +312,7 @@ While...Wend Statement With Statement Write Statement -Xor-Operator +Xor Operator Year Function "-" Operator "*" Operator diff --git a/source/text/sbasic/shared/0300.xhp b/source/text/sbasic/shared/0300.xhp index 51d6f6ed6..c9eff8c04 100644 --- a/source/text/sbasic/shared/0300.xhp +++ b/source/text/sbasic/shared/0300.xhp @@ -43,7 +43,7 @@ - + diff --git a/source/text/sbasic/shared/0311.xhp b/source/text/sbasic/shared/0311.xhp
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 source/auxiliary/sbasic.tree |2 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 56 + source/text/sbasic/shared/03/sf_calc.xhp |2 source/text/sbasic/shared/03/sf_dialog.xhp| 389 +++ source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 770 ++ 6 files changed, 1212 insertions(+), 9 deletions(-) New commits: commit 268d92a454d7839eefb1c4c97bba805141bb874f Author: Alain Romedenne AuthorDate: Wed Jan 20 09:48:49 2021 +0100 Commit: Olivier Hallot CommitDate: Wed Feb 3 23:37:42 2021 +0100 (ScriptForge) SFDialogs library sf_Dialog sf_control new pages - sf_calc unmuting L10N Change-Id: I3799952c29f21570e6faa81c5b1b27bc28786fb5 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109674 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 57cfed0d9..2fad16c6d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -79,6 +79,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_ScriptForge \ helpcontent2/source/text/sbasic/shared/03/sf_array \ helpcontent2/source/text/sbasic/shared/03/sf_calc \ +helpcontent2/source/text/sbasic/shared/03/sf_dialog \ +helpcontent2/source/text/sbasic/shared/03/sf_dialogcontrol \ helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index c10b8e771..fdd05f76f 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -330,7 +330,7 @@ ImportWizard Library Schedule Library ScriptBindingLibrary Library -ScriptForge Library +ScriptForge Libraries Template Library WikiEditor Library diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 2813a026d..98db6187d 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -10,7 +10,7 @@ --> -ScriptForge Library +ScriptForge Libraries /text/sbasic/shared/03/lib_ScriptForge.xhp @@ -24,17 +24,60 @@ GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") - The described modules and classes are invoked from user scripts as "Services". A generic constructor of those services has been designed for that purpose: [ScriptForge.][Services.]CreateScriptService("servicename"[, arg0, Arg1, ...]) - Services from external libraries can be registered with the RegisterScriptServices(...) method in order to extend the set of available services. ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. - +ScriptForge services are organized in the following categories: + + +%PRODUCTNAME Basic +Document content +User interface (UI) +Utilities + + + + +Array +Dictionary +Exception +FileSystem +String +TextStream + + + + +Document +Calc +Database + + + + +UI +Dialog +DialogControls + + + + + +Localization (L10N) +Platform +Services +Session + + + + + + @@ -47,11 +90,10 @@ TextStream class Service - Restricted use for SF_Root, SF_Utils modules as well as internal methods Note: Other ScriptForge undescribed modules are reserved for internal use. Their content is subject to change without notice. -All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros. + All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros. - + \ No newline at end of file diff --git a/source/text/sbasic/shared/03/sf_calc.xhp b/source/text/sbasic/shared/03/sf_calc.xhp index 2f1a3e78a..156ef6a8e 100644 --- a/source/text/sbasic/shared/03/sf_calc.xhp +++ b/source/text/sbasic/shared/03/sf_calc.xhp @@ -382,7 +382,7 @@ Methods - List of Methods in the Calc Service + List of Methods in
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 + source/auxiliary/sbasic.tree|2 + source/text/sbasic/shared/03/lib_importwiz.xhp | 44 source/text/sbasic/shared/03/lib_wikieditor.xhp | 30 4 files changed, 78 insertions(+) New commits: commit b6f441acbef90d0c13e56b2127d19ebb7ed1718d Author: Alain Romedenne AuthorDate: Wed Jul 1 17:14:46 2020 +0200 Commit: Olivier Hallot CommitDate: Thu Jul 2 13:17:34 2020 +0200 Basic advanced libraries brief descriptions Change-Id: I4bdfd0983e52e8741b9082f0bc6dfa1a35b16510 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/97582 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index b24b4901b..9a49cdaab 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -74,9 +74,11 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_depot \ helpcontent2/source/text/sbasic/shared/03/lib_formwizard \ helpcontent2/source/text/sbasic/shared/03/lib_gimmicks \ +helpcontent2/source/text/sbasic/shared/03/lib_importwiz \ helpcontent2/source/text/sbasic/shared/03/lib_script \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ +helpcontent2/source/text/sbasic/shared/03/lib_wikieditor \ helpcontent2/source/text/sbasic/shared/0300 \ helpcontent2/source/text/sbasic/shared/0301 \ helpcontent2/source/text/sbasic/shared/03010100 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 04a13398b..b44630a98 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -322,9 +322,11 @@ Euro Library FormWizard Library Gimmicks Library +ImportWizard Library Schedule Library ScriptBindingLibrary Library Template Library +WikiEditor Library diff --git a/source/text/sbasic/shared/03/lib_importwiz.xhp b/source/text/sbasic/shared/03/lib_importwiz.xhp new file mode 100644 index 0..663bd49d1 --- /dev/null +++ b/source/text/sbasic/shared/03/lib_importwiz.xhp @@ -0,0 +1,44 @@ + + + + + +ImportWizard Library +/text/sbasic/shared/03/lib_importwiz.xhp + + + +The ImportWizard Library + +BASIC ImportWizard library + + + + + + +Description +The ImportWizard library is used by the Document converter... wizard. +Its entry point is: + + ImportWizard.Main.Main + +Selecting the Document Converter... wizard loads the following libraries in memory: + + ImportWizard + Tools + +Basic routine name conflicts may exist when multiple Basic libraries are loaded in memory. + + Tools Basic library + Document Converter describes what the ImportWizard library does. + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03/lib_wikieditor.xhp b/source/text/sbasic/shared/03/lib_wikieditor.xhp new file mode 100644 index 0..2bf31fc1a --- /dev/null +++ b/source/text/sbasic/shared/03/lib_wikieditor.xhp @@ -0,0 +1,30 @@ + + + + + +WikiEditor Library +/text/sbasic/shared/03/lib_wikieditor.xhp + + + +The WikiEditor Library + +BASIC WikiEditor library + + + + + +Description +The WikiEditor library only contains dialogs, it is used by Wiki Publisher bundled Java extension. +This library is not used by %PRODUCTNAME Basic. + + \ No newline at end of file ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |3 + source/text/sbasic/shared/Compiler_options.xhp | 49 + 3 files changed, 52 insertions(+), 1 deletion(-) New commits: commit fcf75206c5f8f59ac464dc3b9b9ca869ce3a7bd5 Author: Alain Romedenne AuthorDate: Wed Jun 17 08:32:31 2020 +0200 Commit: Olivier Hallot CommitDate: Wed Jun 17 23:57:21 2020 +0200 Basic compiler/runtime options aggregation - Base - Explicit - ClassModule - Compatible - Private Module - VBASupport Change-Id: If5edfe93a744d847bc387d868cbb26292b60ea0a Reviewed-on: https://gerrit.libreoffice.org/c/help/+/96493 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 6dcb58d11..b24b4901b 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -362,6 +362,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ +helpcontent2/source/text/sbasic/shared/Compiler_options \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/ErrVBA \ helpcontent2/source/text/sbasic/shared/fragments \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index fc7df973d..04a13398b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -34,6 +34,7 @@ Working with VBA Macros +Compiler options Using Procedures and Functions Libraries, Modules and Dialogs @@ -177,7 +178,7 @@ HasUnoInterfaces Function Hex Function Hour Function -IIf Statement +IIf Function If...Then...Else Statement Imp-Operator InStr Function diff --git a/source/text/sbasic/shared/Compiler_options.xhp b/source/text/sbasic/shared/Compiler_options.xhp new file mode 100644 index 0..675c1891c --- /dev/null +++ b/source/text/sbasic/shared/Compiler_options.xhp @@ -0,0 +1,49 @@ + + + + + + Compiler Options + /text/sbasic/shared/Compiler_options.xhp + + + + + Compiler Options + Runtime conditions + + + + Compiler Options, Runtime Conditions + Compiler options specified at the module level affect %PRODUCTNAME Basic compiler checks and error messages. Basic syntax as well as Basic set of instructions can be different according to the options that are in use. The less Option, the easiest and tolerant %PRODUCTNAME Basic language is. The more Option, the richer and controlled Basic language gets. + + Compiler options must be specified before the executable program code in a module. + + Option Statement diagram + + + + + + + + Option Private Module + Specifies that the scope of the module is that of the Basic library it belongs to. + + Options specified at the module level also affect %PRODUCTNAME Basic runtime conditions. The behaviour of %PRODUCTNAME Basic instructions can differ. + + + Property statement + + + + + + \ No newline at end of file ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03131600.xhp | 11 source/text/sbasic/shared/calc_functions.xhp | 865 +++ source/text/scalc/01/04060115.xhp| 43 - source/text/scalc/01/04060116.xhp|1 6 files changed, 896 insertions(+), 26 deletions(-) New commits: commit 7af288d0fa90e5e31c29014501f06f776a00366a Author: Olivier Hallot AuthorDate: Tue Jun 16 23:57:06 2020 -0300 Commit: Olivier Hallot CommitDate: Wed Jun 17 13:38:36 2020 +0200 tdf#134032 Calling Calc function from basic Change-Id: I7c3c64e0df4d89b46e49afb869f3e2de0825a6e2 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/96485 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 6a53d6bea..6dcb58d11 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -358,6 +358,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ +helpcontent2/source/text/sbasic/shared/calc_functions \ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 804b8613b..fc7df973d 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -50,6 +50,7 @@ Comparison Operators Strings UNO Objects, Functions and Services +Calling Calc functions Exclusive VBA functions Other Commands diff --git a/source/text/sbasic/shared/03131600.xhp b/source/text/sbasic/shared/03131600.xhp index ddf4fe234..b0c499b8c 100644 --- a/source/text/sbasic/shared/03131600.xhp +++ b/source/text/sbasic/shared/03131600.xhp @@ -33,7 +33,7 @@ API;FunctionAccess -CreateUnoService Function +CreateUnoService Function Instantiates a Uno service with the ProcessServiceManager. @@ -45,11 +45,11 @@ Calc functions;API Service -Calling Calc functions in Basic -CreateUnoService function; Calling Calc functions Calling Calc functions in Basic: + +REM The code below does not work for add-in functions, which have a different calling procedure. Function MyVlook(item, InRange As Object, FromCol As Integer) Dim oService As Object oService = createUnoService("com.sun.star.sheet.FunctionAccess") @@ -57,7 +57,7 @@ MyVlook = oService.callFunction("VLOOKUP",Array(item, InRange, FromCol, True)) End Function - + oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" ) @@ -78,5 +78,8 @@ FileOpenDialog=files(0) End Function + + + diff --git a/source/text/sbasic/shared/calc_functions.xhp b/source/text/sbasic/shared/calc_functions.xhp new file mode 100644 index 0..7f0169fd7 --- /dev/null +++ b/source/text/sbasic/shared/calc_functions.xhp @@ -0,0 +1,865 @@ + + + + + + +Calling Calc Functions in Macros +/text/sbasic/shared/calc_functions.xhp + + + + +calling Calc function;macros +macros;calling Calc function +createUNOservice function;calling Calc function +API;addin.Analysis + +Calling Calc Functions +In addition to the native BASIC functions, you can call Calc functions in your macros and scripts. +Calling Internal Calc functions in Basic + Use the CreateUNOService function to access the com.sun.star.sheet.FunctionAccess service. + + +Calling Add-In Calc Functions in BASIC +The Calc Add-In functions are in service com.sun.star.sheet.addin.Analysis. + + +REM Example calling Addin function SQRTPI +Function MySQRTPI(arg as double) as double + Dim oService as Object + oService = createUNOService("com.sun.star.sheet.addin.Analysis") + MySQRTPI = oService.getSqrtPi(arg) +End Function + + + + + +Calc Function name + + +UNO service name + + + + +ACCRINT + + +com.sun.star.sheet.addin.Analysis.getAccrint + + + + +ACCRINTM + + +com.sun.star.sheet.addin.Analysis.getAccrintm + + + + +AMORDEGRC + + +com.sun.star.sheet.addin.Analysis.getAmordegrc + + + + +AMORLINC + + +com.sun.star.sheet.addin.Analysis.getAmorlinc + + + + +BESSELI + + +com.sun.star.sheet.addin.Analysis.getBesseli + + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/Resume.xhp | 77 +++ 3 files changed, 79 insertions(+) New commits: commit abb9f587513acabada8d15c59508baefa7196540 Author: LibreOfficiant AuthorDate: Sun Apr 5 13:28:45 2020 +0100 Commit: Olivier Hallot CommitDate: Thu Apr 9 19:46:44 2020 +0200 tdf#129366 Resume statement new help page its 3 available options are: - 0 - label - Next + associated examples in combination with On Error statement To be rebased past #91709 Change-Id: I0986816580835bf9b2b2657ecdbdc06118b1ff9d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/91712 Tested-by: Olivier Hallot Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4b5999ba1..3860b4549 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -372,6 +372,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ helpcontent2/source/text/sbasic/shared/main0601 \ +helpcontent2/source/text/sbasic/shared/Resume \ helpcontent2/source/text/sbasic/shared/special_vba_func \ helpcontent2/source/text/sbasic/shared/vbasupport \ helpcontent2/source/text/sbasic/python/main \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index d2924a7c7..c9fe8eaf1 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -241,6 +241,7 @@ PV Function [VBA] QBColor Function Rate Function [VBA] +Resume Statement RGB Function RSet Statement RTrim Function diff --git a/source/text/sbasic/shared/Resume.xhp b/source/text/sbasic/shared/Resume.xhp new file mode 100644 index 0..7beae506a --- /dev/null +++ b/source/text/sbasic/shared/Resume.xhp @@ -0,0 +1,77 @@ + + + + + + Resume Statement + /text/sbasic/shared/Resume.xhp + + + + + Resume statement + + + Resume Statement + Resets error information and indicates what to execute next. + + + Resume Statement diagram + + Resume [ [0] | label | Next ] + + +0: Resets error information and re-executes the instruction that caused the error. 0 is optional. +label: Resets error information and executes the instruction at the given label. +Next: Resets error information and executes the instruction following the one that caused the error. +Error information is built with Erl, Err and Error$ functions. + + Erl: Module line number where error occurs. + Err: Error number. + Error[$]: Error description. + +Using Resume to reset error information prevents the propogation of the handled condition to calling routines. + + +Examples: +Typical error handling routines are: alerting the user, fixing the error, logging error information or re-throwing custom errors that provide explanations with resolution instructions. Use Resume label when requiring such mechanisms. + + Sub Error_Handling + try: On Error GoTo catch + ' routine code goes here + Error 91 ' example error + finally: + ' routine cleanup code goes here + Exit Sub + catch: + Print Erl, Err, Error$ + Resume finally + End Sub ' Error_Handling + +Use Resume Next, for example, when reporting anomalies encountered for an iterating process that must not be interrupted. In which case multiple handling routines may be required. + + Sub Iteration + planets = Array("☿","♀","♁","♂","♃","♄","⛢","♆") + try: + On Error GoTo ReportAndProcessNext + For ndx = -3 To 11 Step 1 + MsgBox planets(ndx) + Next + On Error GoTo 0 ' Stop error catching + finally: + Exit Sub + ReportAndProcessNext: + Print "Error " Err " at line " Erl " - " Error$ + Resume Next + End Sub ' Iteration + +Using Resume without parameters to re-execute the faulty instruction can fit certain situations. However that may cause a never ending loop. + + \ No newline at end of file ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/0003.xhp |2 source/text/sbasic/shared/ErrVBA.xhp | 127 + source/text/sbasic/shared/special_vba_func.xhp |5 5 files changed, 133 insertions(+), 3 deletions(-) New commits: commit b6a60949a44df45c1ea13dcd5c7330d327860233 Author: LibreOfficiant AuthorDate: Fri Mar 27 14:24:07 2020 +0100 Commit: Olivier Hallot CommitDate: Thu Apr 2 17:38:09 2020 +0200 VBA Err object - Handling exceptions or Throwing them w/ Basic A limited set of VBA ERR object properties & methods are exhibiting useful features. This page document that subset. Change-Id: I98726a6ffbce370b81f1a26daa35a8a1bf3dc57c Reviewed-on: https://gerrit.libreoffice.org/c/help/+/91177 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 714338107..4b5999ba1 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -362,6 +362,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/enum \ +helpcontent2/source/text/sbasic/shared/ErrVBA \ helpcontent2/source/text/sbasic/shared/partition \ helpcontent2/source/text/sbasic/shared/property \ helpcontent2/source/text/sbasic/shared/replace \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index bbc37c493..74996c65a 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -133,6 +133,7 @@ Eqv Operator Erl Function Err Function +Err Object [VBA] Error Function Error-Handling Functions Exit Statement diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index b1eabffbc..848fb4cbd 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -187,7 +187,7 @@ -This function or constant is enabled with the statement Option VBASupport 1 placed before the executable program code in a module. +This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module. This statement must be added before the executable program code in a module. diff --git a/source/text/sbasic/shared/ErrVBA.xhp b/source/text/sbasic/shared/ErrVBA.xhp new file mode 100644 index 0..0e28e5107 --- /dev/null +++ b/source/text/sbasic/shared/ErrVBA.xhp @@ -0,0 +1,127 @@ + + + + + + Err VBA Object + /text/sbasic/shared/ErrVBA.xhp + + + + + + Err object + Error;raising + Error;handling + + Err Object [VBA] + Use VBA Err object to raise or handle runtime errors. Err is a VBA built-in global object which permits: + + + to raise predefined Basic errors + to throw user-defined exceptions + to name the routine originating the error + to describe the error and possible solutions + + + VBA Err object has the following properties and methods: + Properties + + Err.Description As String + + Description property gives the nature of the error. It details the various reasons that may cause the error. Ideally it provides the multiple course of actions that help solve the issue and prevent its reoccurrence. Its alias is Basic Error function for %PRODUCTNAME predefined errors. + + Err.Number As Long + + This the error code associated with the error. Err object default property is Number. Its alias is %PRODUCTNAME Basic Err function. + + Err.Source As String + + Source indicates the name of the routine that produces the error. Source is an option for user-defined errors. + Methods + + Err.Clear() + + Resets description, Erl, number and source properties of current error. Its alias is %PRODUCTNAME Basic Resume statement. + + Err.Raise(Number As Long, Optional source As String, Optional description As String) + + Throws user-defined errors or predefined errors. Its alias is %PRODUCTNAME Basic Error statement. + Parameters + Number A user-defined or predefined error code to be raised. + Error code range 0-2000 is reserved for %PRODUCTNAME Basic. User-defined errors may start from higher values in order to prevent collision with %PRODUCTNAME Basic future developments. + Source The name of the routine raising the error. A name in the form of myLibrary.myModule.myProc is
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/guide/basic_examples.xhp |2 source/text/sbasic/python/python_document_events.xhp |4 source/text/sbasic/python/python_examples.xhp|2 source/text/sbasic/python/python_handler.xhp | 168 +++ source/text/sbasic/python/python_listener.xhp|8 source/text/sbasic/shared/main0601.xhp |2 8 files changed, 177 insertions(+), 11 deletions(-) New commits: commit 6880ed4b733994558cd6d906850624a6fdc94321 Author: LibreOfficiant AuthorDate: Tue Jul 23 17:16:46 2019 +0200 Commit: Olivier Hallot CommitDate: Fri Jul 26 13:30:28 2019 +0200 Python dialog handler new topic 'Dialog Handler' new topic bunch of x-ref between pages make & toc OH: - fixed broken file path - fixed broken links Change-Id: I37e94fea48c394310298ff6f4b13f22c71c523c4 Reviewed-on: https://gerrit.libreoffice.org/76191 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 1cac18fe4..cc5f02cbc 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -376,6 +376,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/python_dialogs \ helpcontent2/source/text/sbasic/python/python_document_events \ helpcontent2/source/text/sbasic/python/python_examples \ +helpcontent2/source/text/sbasic/python/python_handler \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_import \ helpcontent2/source/text/sbasic/python/python_listener \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 308f10f99..a5eadb85b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -325,6 +325,7 @@ Using Objects Debugging a Basic Program Event-Driven Macros +%PRODUCTNAME Basic Programming Examples Access2Base, the API for Base users diff --git a/source/text/sbasic/guide/basic_examples.xhp b/source/text/sbasic/guide/basic_examples.xhp index 888903b39..c8ece 100644 --- a/source/text/sbasic/guide/basic_examples.xhp +++ b/source/text/sbasic/guide/basic_examples.xhp @@ -22,9 +22,9 @@ Basic Programming Examples + diff --git a/source/text/sbasic/python/python_document_events.xhp b/source/text/sbasic/python/python_document_events.xhp index 49e7303d4..34a3f5a5b 100644 --- a/source/text/sbasic/python/python_document_events.xhp +++ b/source/text/sbasic/python/python_document_events.xhp @@ -267,9 +267,7 @@ - + diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 84330a640..8878962d0 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -26,7 +26,6 @@ Python programming examples @@ -35,6 +34,7 @@ + diff --git a/source/text/sbasic/python/python_handler.xhp b/source/text/sbasic/python/python_handler.xhp new file mode 100644 index 0..31b59f06c --- /dev/null +++ b/source/text/sbasic/python/python_handler.xhp @@ -0,0 +1,168 @@ + + + + + + Creating A Dialog Handler + /text/sbasic/python/python_handler.xhp + + + + + Basic;Dialog Handler + Python;Dialog Handler + Access2Base;dlgTrace + Access2Base;_DumpToFile + API;DialogProvider2 + API;XDialogEventHandler + + Creating a Dialog Handler + Next to assigning macros to events or creating event listeners, one can use dialog handlers, whose principle is to define UNO keywords, or methods, that are mapped to events to watch for. The event handler is responsible for executing methods using the vnd.sun.star.UNO:method_name protocol. Unlike listeners that require to define all supported methods, even if unused, dialog handlers require only two methods on top of intended control hook scripts. + The advantages of this approach are: + + It packs the code that handles event-driven macros, + it decorrelates events from macros names which facilitates maintenance or updates, in particular when moving macros or modules. + + This mechanism is illustrated herewith for Basic and Python languages using an imported copy of Access2Base dlgTrace dialog. Exception handling and localisation are omitted for clarity. + Assigning Dialog methods + Export Access2Base dlgTrace dialog and import it into MyLib application library. + Inside the control
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03120300.xhp |1 source/text/sbasic/shared/replace.xhp | 52 + 4 files changed, 55 insertions(+) New commits: commit e6dfe7b36ebfda217fe89c18b656d2eee72c18ce Author: Olivier Hallot AuthorDate: Thu Mar 14 06:09:37 2019 -0300 Commit: Olivier Hallot CommitDate: Thu Mar 14 15:57:16 2019 +0100 tdf#124066, tdf#114263 BASIC Replace function Help with kind help of Gerhard Weydt (tdf#124066) Change-Id: I856c8ff600774bec82daafdef63ea8cca15b5097 Reviewed-on: https://gerrit.libreoffice.org/69255 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 859e79439..9325e065f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -360,6 +360,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/partition \ +helpcontent2/source/text/sbasic/shared/replace \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 5c633bcbd..8ecb215a0 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -243,6 +243,7 @@ ReDim Statement Red Function Rem Statement +Replace Function Reset Statement Right Function RmDir Statement diff --git a/source/text/sbasic/shared/03120300.xhp b/source/text/sbasic/shared/03120300.xhp index 3d42c6485..024dbd09f 100644 --- a/source/text/sbasic/shared/03120300.xhp +++ b/source/text/sbasic/shared/03120300.xhp @@ -40,6 +40,7 @@ + diff --git a/source/text/sbasic/shared/replace.xhp b/source/text/sbasic/shared/replace.xhp new file mode 100644 index 0..ee17e0fd1 --- /dev/null +++ b/source/text/sbasic/shared/replace.xhp @@ -0,0 +1,52 @@ + + + + + + +Replace Function +/text/sbasic/shared/replace.xhp + + + + + +Replace function + +Replace Function +Replaces some string by another. + + + +Replace (Text As String, SearchStr As String, ReplStr As String [, Start As Long [, Count as long [, Compare As Boolean]]] + + +String + + +Text: Any string expression that you want to modify. +SearchStr: Any string expression that shall be searched for. +ReplStr: Any string expression that shall replace the found search string. +Start: Numeric expression that indicates the character position within the string where the search shall begin. The maximum allowed value is 65535. +Count: The maximal number of times the replace shall be performed. +Compare: Optional boolean expression that defines the type of comparison. The value of this parameter can be TRUE or FALSE. The default value of TRUE specifies a text comparison that is not case-sensitive. The value of FALSE specifies a binary comparison that is case-sensitive. You can as well use 0 instead of FALSE or 1 instead of TRUE. + + + + + + +msgbox replace ("aBbcnnbnn", "b", "$", 1, 1, FALSE) 'returns "aB$cnnbnn" +REM meaning: "b" should be replaced, but +REM * only when lowercase (parameter 6), hence second occurrence of "b" +REM * only first (respecting case) occurrence (parameter 5) + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03103350.xhp | 12 ++--- source/text/sbasic/shared/classmodule.xhp | 13 +++-- source/text/sbasic/shared/compatible.xhp |8 +-- source/text/sbasic/shared/partition.xhp| 60 + source/text/sbasic/shared/special_vba_func.xhp | 15 ++ 7 files changed, 86 insertions(+), 24 deletions(-) New commits: commit 3f27275900a441c45af6c7e91901c98def81623a Author: Olivier Hallot AuthorDate: Fri Jan 25 11:58:07 2019 -0200 Commit: Olivier Hallot CommitDate: Sat Jan 26 12:11:22 2019 +0100 tdf#114263 Help page for Partition [VBA] + some hyperlinks and reordering of text in calssmodule and compatible, option vba support. Change-Id: Ic387086a5874989d22cf93caf0f3d0f48fd77a9e Reviewed-on: https://gerrit.libreoffice.org/66910 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2b54b99fd..e8c2c202f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -359,6 +359,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/enum \ +helpcontent2/source/text/sbasic/shared/partition \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 58fc08930..28d5a1161 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -227,6 +227,7 @@ Option VBASupport Statement Optional (in Function Statement) Or-Operator +Partition Function [VBA] Pmt Function [VBA] PPmt Function [VBA] PV Function [VBA] diff --git a/source/text/sbasic/shared/03103350.xhp b/source/text/sbasic/shared/03103350.xhp index 015d57770..80f3f0a9c 100644 --- a/source/text/sbasic/shared/03103350.xhp +++ b/source/text/sbasic/shared/03103350.xhp @@ -39,12 +39,11 @@ Specifies that %PRODUCTNAME Basic will support some VBA statements, functions and objects. The support for VBA is not complete, but covers a large portion of the common usage patterns. - + Option VBASupport {1|0} - 1: Enable VBA support in %PRODUCTNAME 0: Disable VBA support @@ -53,15 +52,18 @@ Option VBASupport 1 Sub ExampleVBA -Dim sVar As Single - sVar = Worksheets("Sheet1").Range("A1") -Print sVar +Dim sVar As Single +sVar = Worksheets("Sheet1").Range("A1") +Print sVar End Sub VBA Properties VBA support in %PRODUCTNAME + + + diff --git a/source/text/sbasic/shared/classmodule.xhp b/source/text/sbasic/shared/classmodule.xhp index a6ddac738..13d95b9cb 100644 --- a/source/text/sbasic/shared/classmodule.xhp +++ b/source/text/sbasic/shared/classmodule.xhp @@ -18,13 +18,16 @@ Option ClassModule - Option ClassModule Statement - Specifies that the module is a class module that contains members, properties, procedures and functions. - - Option ClassModule + + + Option ClassModule Statement + Specifies that the module is a class module that contains members, properties, procedures and functions. + + - This statement must be added before the executable program code in a module. This statement must be used jointly with Option Compatible statement or Option VBASupport 1, the former is enabling VBA compatibility mode, while the latter is enforcing VBA support on top of compatibility. + + Option ClassModule Option Compatible diff --git a/source/text/sbasic/shared/compatible.xhp b/source/text/sbasic/shared/compatible.xhp index 3d8824adf..d533ceaf7 100644 --- a/source/text/sbasic/shared/compatible.xhp +++ b/source/text/sbasic/shared/compatible.xhp @@ -23,9 +23,9 @@ Option Compatible Statement +Option Compatible turns on VBA compatible Basic compiler mode at module level. Function CompatibilityMode() controls runtime mode and affects all code executed after setting or resetting the mode. -Option Compatible turns on VBA compatible Basic compiler mode at module level. Function CompatibilityMode() controls runtime mode and affects all code executed after setting or resetting the mode. This option may affect or assist in the following situations: Allow special characters as identifiers. @@ -40,10 +40,10 @@ Option Compatible -CompatibilityMode() function - +CompatibilityMode()
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 source/auxiliary/sbasic.tree |3 + source/text/sbasic/shared/0003.xhp|3 + source/text/sbasic/shared/03090407.xhp| 14 ++--- source/text/sbasic/shared/03103200.xhp| 13 ++--- source/text/sbasic/shared/03103300.xhp| 15 ++ source/text/sbasic/shared/03103350.xhp| 20 +++- source/text/sbasic/shared/classmodule.xhp | 60 source/text/sbasic/shared/compatible.xhp | 73 ++ 9 files changed, 166 insertions(+), 37 deletions(-) New commits: commit 441f600d210bd69e4c485c1520eff55a42aa0a2c Author: Alain Romedenne AuthorDate: Wed Jan 23 19:02:00 2019 -0200 Commit: Olivier Hallot CommitDate: Thu Jan 24 11:50:31 2019 +0100 tdf#114263 Undocumented BASIC Options Option Compatible Option ClassModule Change-Id: Ieb07fddb216f4f8cc26089a30226da5760b0065e Reviewed-on: https://gerrit.libreoffice.org/66824 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 16cac3877..2b54b99fd 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -356,6 +356,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ +helpcontent2/source/text/sbasic/shared/classmodule \ +helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 2bc0305b6..58fc08930 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -78,6 +78,7 @@ CDec Function CInt Function CLng Function +CompatibilityMode Function CSng Function CStr Function Call Statement @@ -220,6 +221,8 @@ On...GoSub Statement; On...GoTo Statement Open Statement Option Base Statement +Option ClassModule statement +Option Compatible statement Option Explicit Statement Option VBASupport Statement Optional (in Function Statement) diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index a56925dcd..fd5df791d 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -189,6 +189,9 @@ This function or constant is enabled with the statement Option VBASupport 1 placed before the executable program code in a module. + +This statement must be added before the executable program code in a module. + Syntax: diff --git a/source/text/sbasic/shared/03090407.xhp b/source/text/sbasic/shared/03090407.xhp index bdfb4784c..360c6fbdd 100644 --- a/source/text/sbasic/shared/03090407.xhp +++ b/source/text/sbasic/shared/03090407.xhp @@ -35,21 +35,19 @@ -Rem Statement +Rem Statement Specifies that a program line is a comment. -Syntax: - -Rem Text - + +Rem Text -Parameters: + Text: Any text that serves as a comment. You can use the single quotation mark instead of the Rem keyword to indicate that the text on a line is comments. This symbol can be inserted directly to the right of the program code, followed by a comment. You can use a space followed by the underline character _ as the last two characters of a line to continue the logical line on the next line. To continue comment lines, you must enter "Option Compatible" in the same Basic module. -Example: + Sub ExampleMid Dim sVar As String @@ -60,4 +58,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03103200.xhp b/source/text/sbasic/shared/03103200.xhp index 33560b1e3..d7418435a 100644 --- a/source/text/sbasic/shared/03103200.xhp +++ b/source/text/sbasic/shared/03103200.xhp @@ -32,19 +32,17 @@ Option Base statement -Option Base Statement +Option Base Statement Defines the default lower boundary for arrays as 0 or 1. -Syntax: - -Option Base { 0 | 1} - + +Option Base { 0 | 1} -Parameters: + This statement must be added before the executable program code in a module. -Example: + Option Base 1 Sub ExampleOptionBase @@ -53,5 +51,4 @@ End Sub - diff --git a/source/text/sbasic/shared/03103300.xhp b/source/text/sbasic/shared/03103300.xhp index 6aadb83d6..96c490d39 100644 --- a/source/text/sbasic/shared/03103300.xhp +++ b/source/text/sbasic/shared/03103300.xhp @@ -32,19 +32,17 @@ Option Explicit statement -Option Explicit Statement +Option
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03080500.xhp |9 +++--- source/text/sbasic/shared/03080501.xhp | 20 +++--- source/text/sbasic/shared/03080502.xhp | 18 +++- source/text/sbasic/shared/03080503.xhp | 47 + 6 files changed, 74 insertions(+), 22 deletions(-) New commits: commit d7124af74ae46cf33d1c23931b0041a40d845abb Author: Olivier Hallot AuthorDate: Sun Dec 30 17:27:44 2018 -0200 Commit: Olivier Hallot CommitDate: Sun Dec 30 23:20:51 2018 +0100 tdf#114263 Add Help page for BASIC Frac Function Change-Id: Icc56a51597318d5c0683a2976b8d08f1b30ca49c Reviewed-on: https://gerrit.libreoffice.org/65752 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 21f958963..f9b8f4b93 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -189,6 +189,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03080500 \ helpcontent2/source/text/sbasic/shared/03080501 \ helpcontent2/source/text/sbasic/shared/03080502 \ +helpcontent2/source/text/sbasic/shared/03080503 \ helpcontent2/source/text/sbasic/shared/03080600 \ helpcontent2/source/text/sbasic/shared/03080601 \ helpcontent2/source/text/sbasic/shared/03080700 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index a803d00b1..c05ecbac5 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -146,6 +146,7 @@ Format Function FormatDateTime Function [VBA] FormatNumber Function [VBA] +Frac Function FreeFile Function FreeLibrary Function Function Statement diff --git a/source/text/sbasic/shared/03080500.xhp b/source/text/sbasic/shared/03080500.xhp index 7e3bdda9d..06efe78a2 100644 --- a/source/text/sbasic/shared/03080500.xhp +++ b/source/text/sbasic/shared/03080500.xhp @@ -30,13 +30,14 @@ - - + + - Integers - The following functions round values to integers. + Integers and Fractional + Functions to round values to integers, and to take the fractional part of a value. + diff --git a/source/text/sbasic/shared/03080501.xhp b/source/text/sbasic/shared/03080501.xhp index 6c436534b..97e9ee82f 100644 --- a/source/text/sbasic/shared/03080501.xhp +++ b/source/text/sbasic/shared/03080501.xhp @@ -32,26 +32,22 @@ Fix function - - Fix Function Returns the integer value of a numeric expression by removing the fractional part of the number. -Syntax: - -Fix (Expression) - + +Fix (Expression) -Return value: + Double -Parameters: + Expression: Numeric expression that you want to return the integer value for. -Example: + Sub ExampleFix Print Fix(3.14159) ' returns 3. @@ -59,6 +55,10 @@ Print Fix(-3.14159) ' returns -3. End Sub + +Int Function +Frac Function + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03080502.xhp b/source/text/sbasic/shared/03080502.xhp index cb259a34a..147c862a9 100644 --- a/source/text/sbasic/shared/03080502.xhp +++ b/source/text/sbasic/shared/03080502.xhp @@ -38,20 +38,18 @@ Returns the integer portion of a number. -Syntax: - -Int (Number) - + +Int (Number) -Return value: + Double -Parameters: + Number: Any valid numeric expression. -Example: + Sub ExampleInt Print Int(3.99) ' returns the value 3 @@ -59,6 +57,10 @@ Print Int(-3.14159) ' returns the value -4 End Sub + +Fix Function +Frac Function + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03080503.xhp b/source/text/sbasic/shared/03080503.xhp new file mode 100644 index 0..282a81a0a --- /dev/null +++ b/source/text/sbasic/shared/03080503.xhp @@ -0,0 +1,47 @@ + + + + + + +Frac Function +/text/sbasic/shared/03080503.xhp + + + + + +Frac function + +Frac Function +Returns the fractional portion of a number. + + +Frac (Number) + +Double + + Number: Any valid numeric expression. + + + + +Sub ExampleFrac +Print Frac(3.99) ' returns the value 0.99 +Print Frac(0) ' returns the value 0 +Print Frac(-3.14159) ' returns the value -0.14159 +End Sub + + +Fix Function +Int Function + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 + source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/0313.xhp| 11 source/text/sbasic/shared/stardesktop.xhp | 36 + source/text/sbasic/shared/uno_objects.xhp | 37 ++ 5 files changed, 77 insertions(+), 10 deletions(-) New commits: commit 3f0f452519618e4b0bd0b97a855fc5ffe5514a49 Author: Alain Romedenne AuthorDate: Tue Dec 11 16:54:46 2018 -0200 Commit: Olivier Hallot CommitDate: Wed Dec 12 10:10:46 2018 +0100 StarDesktop object and reorder indexes Add StarDesktop object description Reorder "Other commands" to add UNO objects Change-Id: Ia6547ea059276f8946b03392d29d968187bcd26c Signed-off-by: Olivier Hallot Reviewed-on: https://gerrit.libreoffice.org/64981 Tested-by: Jenkins diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index f1f3ad896..ec22b518e 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -364,6 +364,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/main \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_locations \ +helpcontent2/source/text/sbasic/shared/stardesktop \ +helpcontent2/source/text/sbasic/shared/uno_objects \ )) # vim: set noet sw=4 ts=4: diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index b71d4c21b..6e3fcd842 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -49,6 +49,7 @@ Basic Constants Comparison Operators Strings +UNO Objects, Functions and Services Exclusive VBA functions Other Commands diff --git a/source/text/sbasic/shared/0313.xhp b/source/text/sbasic/shared/0313.xhp index 578b685ab..9be85339e 100644 --- a/source/text/sbasic/shared/0313.xhp +++ b/source/text/sbasic/shared/0313.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 . --> - + @@ -43,15 +43,6 @@ - - - - - - - - - diff --git a/source/text/sbasic/shared/stardesktop.xhp b/source/text/sbasic/shared/stardesktop.xhp new file mode 100644 index 0..d4d215cc3 --- /dev/null +++ b/source/text/sbasic/shared/stardesktop.xhp @@ -0,0 +1,36 @@ + + + + + +StarDesktop +/text/sbasic/shared/stardesktop.xhp + + + + + + +StarDesktop + + +StarDesktop +The StarDesktop object represents %PRODUCTNAME application. Some routines or user interface objects such as current window can be used via StarDesktop. + +Example: + +dim docURL As String +doc As Object, docProperties() +docURL = ConvertToURL(C:\My Documents\example.odt) +doc = StarDesktop.LoadComponentFromURL(docURL, _blank, 0, docProperties) + + + + diff --git a/source/text/sbasic/shared/uno_objects.xhp b/source/text/sbasic/shared/uno_objects.xhp new file mode 100644 index 0..ccdb4a560 --- /dev/null +++ b/source/text/sbasic/shared/uno_objects.xhp @@ -0,0 +1,37 @@ + + + + + + +UNO Objects +/text/sbasic/shared/uno_objects.xhp + + + + +UNO Objects, Functions and Services +Functions, objects and services of Unified Network Objects (UNO). + + + + + + + + + + + + + + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03120412.xhp |2 - source/text/sbasic/shared/enum.xhp | 50 + source/text/sbasic/shared/special_vba_func.xhp |9 5 files changed, 60 insertions(+), 3 deletions(-) New commits: commit 93b7b1c8c79744b8d172dc0f2bbdf8a80e05abd8 Author: Alain Romedenne AuthorDate: Wed Nov 28 23:58:44 2018 -0200 Commit: Olivier Hallot CommitDate: Thu Nov 29 21:41:15 2018 +0100 Help pages for VBA Enum statement Change-Id: I4f382453334aa964115d30d7e11e7d202d63a230 Reviewed-on: https://gerrit.libreoffice.org/64202 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4b3323aac..f1f3ad896 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -354,6 +354,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ +helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 03818d0e7..b71d4c21b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -122,6 +122,7 @@ Do...Loop Statement Comparison Operators End Statement +Enum Statement [VBA] Environ Function Eof Function EqualUnoObjects Function diff --git a/source/text/sbasic/shared/03120412.xhp b/source/text/sbasic/shared/03120412.xhp index ff0462f23..0bf1202fb 100644 --- a/source/text/sbasic/shared/03120412.xhp +++ b/source/text/sbasic/shared/03120412.xhp @@ -32,8 +32,6 @@ StrReverse function - - StrReverse Function [VBA] Returns the string with the character order reversed. diff --git a/source/text/sbasic/shared/enum.xhp b/source/text/sbasic/shared/enum.xhp new file mode 100644 index 0..f891c7cbf --- /dev/null +++ b/source/text/sbasic/shared/enum.xhp @@ -0,0 +1,50 @@ + + + + +Enum Statement +/text/sbasic/shared/enum.xhp + + + + + +Enum statement +constants groups +enumerations + + + +Enum Statement [VBA] +Define enumerations or non UNO constant groups. An enumeration is a value list that facilitates programming and eases code logic review. + + + +Enum +Object Statement block +End Enum +Parameters: +Within a given enumeration, fit together values that logically relate to one another. + + +Option VBASupport 1 +Private Enum _WindowManager +W1ND0WS = 1 Windows +OS2PM = 2 OS/2 Presentation Manager +MACINTOSH = 3 Macintosh +MOTIF = 4 Motif Window Manager / Unix-like +OPENLOOK = 5 Open Look / Unix-like +End Enum + +Enumerated values are rendered to Long datatype. Basic functions are public accessors to enumerations. Enumeration names and value names must be unique within a library and across modules. + + + +Const statement, constants + + +Option VBASupport statement + + + + diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index 634891e7a..54762cc8e 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -34,11 +34,18 @@ -Exclusive VBA functions +Exclusive VBA Functions and Statements %PRODUCTNAME Basic adds this set of functions when VBA support is enabled These exclusive VBA functions are enabled when the statement Option VBASupport 1 is placed before the first macro of a %PRODUCTNAME Basic module. + + +VBA Statements + +VBA Statements + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |3 source/auxiliary/sbasic.tree | 637 - source/text/sbasic/python/main.xhp | 39 + source/text/sbasic/python/python_ide.xhp | 32 + source/text/sbasic/python/python_locations.xhp | 29 + source/text/shared/00/0406.xhp |3 source/text/shared/01/0613.xhp | 16 7 files changed, 442 insertions(+), 317 deletions(-) New commits: commit 949606895b8d46fb97b0bfcda25cfb04f1f61e32 Author: Olivier Hallot AuthorDate: Tue Nov 27 22:10:50 2018 -0200 Commit: Olivier Hallot CommitDate: Wed Nov 28 10:48:08 2018 +0100 tdf#121736 initial Help pages for Python scripts Work in progress, initial addition of help pages for python scripts in LO. Change-Id: Iee95b1340c821fdb08524fdedeca3817b0de1459 Reviewed-on: https://gerrit.libreoffice.org/64137 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 8515bb65a..4b3323aac 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -360,6 +360,9 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/main0601 \ helpcontent2/source/text/sbasic/shared/special_vba_func \ helpcontent2/source/text/sbasic/shared/vbasupport \ +helpcontent2/source/text/sbasic/python/main \ +helpcontent2/source/text/sbasic/python/python_ide \ +helpcontent2/source/text/sbasic/python/python_locations \ )) # vim: set noet sw=4 ts=4: diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index fbae74d0d..03818d0e7 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -1,320 +1,327 @@ - - -%PRODUCTNAME Basic Help -Programming with %PRODUCTNAME Basic -%PRODUCTNAME Basic Glossary -Basics -Syntax -%PRODUCTNAME Basic IDE -IDE Overview -The Basic Editor -Watch Window -Macro Toolbar -Macro -Working with VBA Macros - - -Using Procedures and Functions -Libraries, Modules and Dialogs - -Screen I/O Functions -File I/O Functions -Date and Time Functions -Error-Handling Functions -Logical Operators -Mathematical Operators -Numeric Functions -Controlling Program Execution -Variables -Basic Constants -Comparison Operators -Strings -Exclusive VBA functions -Other Commands - - -Abs Function -AND Operator -Array Function -Asc Function -AscW Function [VBA] -Atn Function -Beep Statement -Blue Function -CBool Function -CByte Function -CCur Function -CDateFromUnoDateTime Function -CDateToUnoDateTime Function -CDateFromUnoTime Function -CDateToUnoTime Function -CDateFromUnoDate Function -CDateToUnoDate Function -CDateFromIso Function -CDateToIso Function -CDate Function -CDbl Function -CDec Function -CInt Function -CLng Function -CSng Function -CStr Function -Call Statement -ChDir Statement -ChDrive Statement -Choose Function -Chr Function -ChrW Function [VBA] -Close Statement -Comparison Operators -Const Statement -ConvertFromURL Function -ConvertToURL Function -Cos Function -CreateObject Function -CreateUnoDialog Function -CreateUnoListener Function -CreateUnoService Function -CreateUnoStruct Function -CreateUnoValue Function -CurDir Function -CVar Function -CVErr Function -DateAdd Function -DateDiff Function -DatePart Function -DateSerial Function -DateValue Function -Date Statement -Day Function -DDB Function [VBA] -Declare Statement -DefBool Statement -DefDate Statement -DefDbl Statement -DefInt Statement -DefLng Statement -DefObj Statement -DefVar Statement -DimArray Function -Dim Statement -Dir Function -Do...Loop Statement -Comparison Operators -End Statement -Environ Function -Eof Function -EqualUnoObjects Function -Eqv Operator -Erl Function -Err Function -Error Function -Error-Handling Functions -Exit Statement -Exp Function -FileAttr Function -FileCopy Statement -FileDateTime Function -FileExists Function -FileLen Function -FindObject Function -FindPropertyObject Function -Fix Function -For...Next Statement -Format Function -FormatDateTime Function [VBA] -FormatNumber Function [VBA] -FreeFile Function -FreeLibrary Function -Function Statement -Further Statements -FV Function [VBA] -Generating Random Numbers -GetAttr Function -GetDefaultContext Function -GetGUIType Function -GetProcessServiceManager Function -GetPathSeparator Function -GetSolarVersion Function -GetSystemTicks Function -Get Statement -GlobalScope -GoSub...Return Statement -GoTo Statement -Green Function -HasUnoInterfaces Function -Hex Function -Hour Function -IIf Statement -If...Then...Else Statement -Imp-Operator -InStr Function -InStrRev Function [VBA] -Input Function [VBA] -InputBox Function -Input# Statement -Int Function -IPmt Function [VBA] -IRR Function [VBA] -IsArray Function -IsDate Function
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03020400.xhp |5 + source/text/sbasic/shared/GetPathSeparator.xhp | 72 + 4 files changed, 77 insertions(+), 2 deletions(-) New commits: commit 3954a99fbd09ead9543cb0e9c682cbf2f69dae8f Author: Alain Romedenne AuthorDate: Thu Nov 22 12:49:14 2018 -0200 Commit: Olivier Hallot CommitDate: Fri Nov 23 14:06:17 2018 +0100 tdf#114263 add help page for GetPathSelector() Change-Id: I021dcde2c5bb27713cbbff03af9f3662f187be4b Signed-off-by: Olivier Hallot Reviewed-on: https://gerrit.libreoffice.org/63807 Tested-by: Jenkins diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index a236018f4..8515bb65a 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -354,6 +354,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03170010 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ +helpcontent2/source/text/sbasic/shared/GetPathSeparator \ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ helpcontent2/source/text/sbasic/shared/main0601 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index d2eb5ea53..fbae74d0d 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -153,6 +153,7 @@ GetDefaultContext Function GetGUIType Function GetProcessServiceManager Function +GetPathSeparator Function GetSolarVersion Function GetSystemTicks Function Get Statement diff --git a/source/text/sbasic/shared/03020400.xhp b/source/text/sbasic/shared/03020400.xhp index d7df5e848..27592c63a 100644 --- a/source/text/sbasic/shared/03020400.xhp +++ b/source/text/sbasic/shared/03020400.xhp @@ -30,8 +30,8 @@ - - + + Managing Files The functions and statements for managing files are described here. @@ -46,6 +46,7 @@ + diff --git a/source/text/sbasic/shared/GetPathSeparator.xhp b/source/text/sbasic/shared/GetPathSeparator.xhp new file mode 100644 index 0..d4c63c536 --- /dev/null +++ b/source/text/sbasic/shared/GetPathSeparator.xhp @@ -0,0 +1,72 @@ + + + + + +Libre Librәries : GetPathSeparator function +/text/sbasic/shared/GetPathSeparator.xhp + + + + +GetPathSeparator function + + +GetPathSeparator Function +Return the operating system dependent directory separator used to specify file paths. + +Syntax: +GetPathSeparator() + +Return value: + +String + +\ Windows + + +/ UNIX, including MacOS + + +Parameters: + + +None. + + +Error codes: + + +5 Invalid procedure call + + +Example: + + +Sub ExampleGetPathSeparator +MsgBox GetPathSeparator() +End Sub + + + +It is recommended to use: + + +ConvertFromURL function to convert a file URL to s system file name. + + +ConvertToURL function to convert a system file name to a file URL. + + +See also URL Notation + + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/0304.xhp | 279 ++--- source/text/sbasic/shared/03170010.xhp | 118 ++ source/text/sbasic/shared/special_vba_func.xhp |5 5 files changed, 282 insertions(+), 122 deletions(-) New commits: commit f33281a5c92c9daa241979cd461c21f3e5cec309 Author: Olivier Hallot AuthorDate: Wed Nov 14 12:56:15 2018 -0200 Commit: Mike Kaganski CommitDate: Thu Nov 15 20:07:08 2018 +0100 tdf#118473 Help page for VBA FormatNumber + some fixes in table formatting * Added Mike's advise. * fix dumb copypasta Change-Id: I997c3200e521e7fac9f20f17a9bb9e2574bccfdd Reviewed-on: https://gerrit.libreoffice.org/63373 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4e283aa77..a236018f4 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -351,6 +351,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03150002 \ helpcontent2/source/text/sbasic/shared/0316 \ helpcontent2/source/text/sbasic/shared/0317 \ +helpcontent2/source/text/sbasic/shared/03170010 \ 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 2838f9698..d2eb5ea53 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -142,6 +142,7 @@ For...Next Statement Format Function FormatDateTime Function [VBA] +FormatNumber Function [VBA] FreeFile Function FreeLibrary Function Function Statement diff --git a/source/text/sbasic/shared/0304.xhp b/source/text/sbasic/shared/0304.xhp index b223fa71f..7630de563 100644 --- a/source/text/sbasic/shared/0304.xhp +++ b/source/text/sbasic/shared/0304.xhp @@ -62,24 +62,24 @@ -True +True -Boolean +Boolean -1 +1 -False +False -Boolean +Boolean -0 +0 @@ -106,13 +106,13 @@ -Pi +Pi -Double +Double -3.14159265358979 +3.14159265358979 @@ -140,32 +140,32 @@ -Empty +Empty -Variant +Variant -The Empty value indicates that the variable is not initialized. +The Empty value indicates that the variable is not initialized. -Null +Null -null +null -Indicates that the variable does not contain data. +Indicates that the variable does not contain data. -Nothing +Nothing -Object +Object Assign the Nothing object to a variable to remove a previous assignment. @@ -192,111 +192,146 @@ Print oDoc ‘ Error End Sub -Additional VBA constants -The following constants are available when VBA compatibility mode is enabled + +Additional VBA constants +The following constants are available when VBA compatibility mode is enabled - - - - -Named constant - - -Hexadecimal (decimal) value - - -Description - - - - -vbCr - - -\x0D (13) - - -CR - Carriage return - - - - -vbCrLf - - -\x0D\x0A (13 10) - - -CRLF - Carriage return and line feed - - - - -vbFormFeed - - -\x0c (12) - - -FF - Form feed -
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |2 +- source/auxiliary/sbasic.tree |2 +- source/text/sbasic/shared/03/lib_schedule.xhp |2 +- source/text/sbasic/shared/main0601.xhp|2 +- 4 files changed, 4 insertions(+), 4 deletions(-) New commits: commit d1cacd356d203bd855eeb235f1374100bed3aa08 Author: Olivier Hallot Date: Wed Jul 11 07:40:48 2018 -0300 Fix more typos in GIMMICKS name here and there Change-Id: Iae95e2aaa42f273effa3b7576da7e6c45495c5c6 Reviewed-on: https://gerrit.libreoffice.org/57273 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index b716e..4e283aa77 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -71,7 +71,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_euro \ helpcontent2/source/text/sbasic/shared/03/lib_depot \ helpcontent2/source/text/sbasic/shared/03/lib_formwizard \ -helpcontent2/source/text/sbasic/shared/03/lib_gimnicks \ +helpcontent2/source/text/sbasic/shared/03/lib_gimmicks \ helpcontent2/source/text/sbasic/shared/03/lib_script \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 97bd34e0d..27ca37239 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -294,7 +294,7 @@ Depot Library Euro Library FormWizard Library -Gimnicks Library +Gimmicks Library Schedule Library ScriptBindingLibrary Library Template Library diff --git a/source/text/sbasic/shared/03/lib_schedule.xhp b/source/text/sbasic/shared/03/lib_schedule.xhp index 3f5bc7ef3..00cf3dcc8 100644 --- a/source/text/sbasic/shared/03/lib_schedule.xhp +++ b/source/text/sbasic/shared/03/lib_schedule.xhp @@ -18,7 +18,7 @@ The Schedule Library -BASIC Template library +BASIC Schedule library diff --git a/source/text/sbasic/shared/main0601.xhp b/source/text/sbasic/shared/main0601.xhp index 558ea5c63..fd3f5bb13 100644 --- a/source/text/sbasic/shared/main0601.xhp +++ b/source/text/sbasic/shared/main0601.xhp @@ -56,7 +56,7 @@ - + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |8 source/auxiliary/sbasic.tree| 10 source/text/sbasic/shared/0003.xhp | 10 source/text/sbasic/shared/03/lib_depot.xhp | 28 source/text/sbasic/shared/03/lib_euro.xhp | 30 source/text/sbasic/shared/03/lib_formwizard.xhp | 28 source/text/sbasic/shared/03/lib_gimnicks.xhp | 30 source/text/sbasic/shared/03/lib_schedule.xhp | 30 source/text/sbasic/shared/03/lib_script.xhp | 30 source/text/sbasic/shared/03/lib_template.xhp | 28 source/text/sbasic/shared/03/lib_tools.xhp | 1360 source/text/sbasic/shared/main0601.xhp | 11 source/text/shared/need_help.xhp| 12 13 files changed, 1599 insertions(+), 16 deletions(-) New commits: commit 79ed6797fcdaa70f6993d34070a3d033440761c2 Author: Olivier Hallot Date: Fri Jun 15 11:46:35 2018 -0300 Add help pages for internal Basic libraries (WIP) LibreOffice ships Basic libraries with many nice Functions and Subs that are not documented at all. These pages shed some light to these libraries and is a work in progress. Change-Id: Icb237bf552b785e576e984e47fd0c5cf4f7e29d7 Reviewed-on: https://gerrit.libreoffice.org/55876 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2ffab07cf..b716e 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -67,6 +67,14 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/02/1118 \ helpcontent2/source/text/sbasic/shared/02/1119 \ helpcontent2/source/text/sbasic/shared/02/2000 \ +helpcontent2/source/text/sbasic/shared/03/lib_tools \ +helpcontent2/source/text/sbasic/shared/03/lib_euro \ +helpcontent2/source/text/sbasic/shared/03/lib_depot \ +helpcontent2/source/text/sbasic/shared/03/lib_formwizard \ +helpcontent2/source/text/sbasic/shared/03/lib_gimnicks \ +helpcontent2/source/text/sbasic/shared/03/lib_script \ +helpcontent2/source/text/sbasic/shared/03/lib_schedule \ +helpcontent2/source/text/sbasic/shared/03/lib_template \ helpcontent2/source/text/sbasic/shared/0300 \ helpcontent2/source/text/sbasic/shared/0301 \ helpcontent2/source/text/sbasic/shared/03010100 \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 02eb3bb2e..97bd34e0d 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -289,7 +289,17 @@ "/" Operator "^" Operator + +Tools Library +Depot Library +Euro Library +FormWizard Library +Gimnicks Library +Schedule Library +ScriptBindingLibrary Library +Template Library + Recording a Macro Changing the Properties of Controls in the Dialog Editor diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index a067682d9..a56925dcd 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -177,7 +177,13 @@ + + +Open Tools - Macros - %PRODUCTNAME Basic - Edit and select %PRODUCTNAME Macros container. + + +This library must be loaded before execution. Place the following statement before the first macro in your module: @@ -185,22 +191,18 @@ - Syntax: - Return value: - Parameters: - Example: diff --git a/source/text/sbasic/shared/03/lib_depot.xhp b/source/text/sbasic/shared/03/lib_depot.xhp new file mode 100644 index 0..2c4a01ba1 --- /dev/null +++ b/source/text/sbasic/shared/03/lib_depot.xhp @@ -0,0 +1,28 @@ + + + + + + +DEPOT Library +/text/sbasic/shared/03/lib_depot.xhp + + + +The Depot Library + + + + + +GlobalScope.BasicLibraries.LoadLibrary("Depot") + + + diff --git a/source/text/sbasic/shared/03/lib_euro.xhp b/source/text/sbasic/shared/03/lib_euro.xhp new file mode 100644 index 0..5141854ee --- /dev/null +++ b/source/text/sbasic/shared/03/lib_euro.xhp @@ -0,0 +1,30 @@ + + + + + + +EURO Library +/text/sbasic/shared/03/lib_euro.xhp + + + +The Euro Library + +BASIC Euro library + + + + + +GlobalScope.BasicLibraries.LoadLibrary("Euro") + + + diff --git a/source/text/sbasic/shared/03/lib_formwizard.xhp b/source/text/sbasic/shared/03/lib_formwizard.xhp new file mode 100644 index 0..c3ff82a11 --- /dev/null +++ b/source/text/sbasic/shared/03/lib_formwizard.xhp @@ -0,0 +1,28 @@ + + + + + + +FORMWIZARD Library +/text/sbasic/shared/03/lib_formwizard.xhp + + + +The FormWizard Library + + + + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140010.xhp | 77 + source/text/sbasic/shared/special_vba_func.xhp |4 - 4 files changed, 80 insertions(+), 3 deletions(-) New commits: commit 9411338fe715ff1c7190ec0761b5b54d40f1f5fb Author: Olivier HallotDate: Mon Jul 24 00:54:24 2017 -0300 tdf#108678 Help page for VBA function Rate Change-Id: Ied97ddb4654817c705108b77a62dedcf3b001e34 Reviewed-on: https://gerrit.libreoffice.org/40352 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d2c2ee8cb..d576d7aa4 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -334,6 +334,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140007 \ helpcontent2/source/text/sbasic/shared/03140008 \ helpcontent2/source/text/sbasic/shared/03140009 \ +helpcontent2/source/text/sbasic/shared/03140010 \ 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 04ec3e5a6..26531c192 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -212,6 +212,7 @@ Public Statement [Runtime] Put Statement [Runtime] QBColor Function [Runtime] +Rate Function [Runtime - VBA] RGB Function [Runtime] RSet Statement [Runtime] RTrim Function [Runtime] diff --git a/source/text/sbasic/shared/03140010.xhp b/source/text/sbasic/shared/03140010.xhp new file mode 100644 index 0..30767b726 --- /dev/null +++ b/source/text/sbasic/shared/03140010.xhp @@ -0,0 +1,77 @@ + + + + + + +Rate Function [Runtime - VBA] +/text/sbasic/shared/03140010.xhp + + + + + + + + + Rate function + + + +Rate Function [Runtime - VBA] +Returns the Present Value of an investment resulting from a series of regular payments. + + + + +Pmt( NPer as Double, Pmt as Double, PV as Double [FV as Variant], [Due as Variant], [Guess as Variant] ) + + +Double + +NPer is the total number of periods, during which annuity is paid. +Pmt is the regular payment made per period. +PV is the present value of the loan / investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. +Guess(optional) determines the estimated value of the interest with iterative calculation. + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExampleRate +' Calculate the interest rate required to pay off a loan of $100,000 over +' 6 years, with payments of $1,500, due at the end of each month. + Dim mRate As Double + mRate = Rate( 72, -1500, 10 ) + print mRate' mRate is calculated to be 0.00213778025343334 +End sub + + + +RATE function in CALC + + + + + \ 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 39f33a57f..dd4998ba0 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -64,12 +64,10 @@ + -Rate - - SLN ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140009.xhp | 76 + source/text/sbasic/shared/special_vba_func.xhp |4 - 4 files changed, 79 insertions(+), 3 deletions(-) New commits: commit f6339f94698ce20caf72c6fb3d84dcf43f7e5855 Author: Olivier HallotDate: Mon Jul 24 00:12:29 2017 -0300 tdf#108677 Help page for VBA function PV Change-Id: Iacd0db8577cc1807b69306cf2d950326f49c2a9c Reviewed-on: https://gerrit.libreoffice.org/40351 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index e4c4d2a6d..d2c2ee8cb 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -333,6 +333,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140006 \ helpcontent2/source/text/sbasic/shared/03140007 \ helpcontent2/source/text/sbasic/shared/03140008 \ +helpcontent2/source/text/sbasic/shared/03140009 \ 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 f8453e5fe..04ec3e5a6 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -207,6 +207,7 @@ Or-Operator [Runtime] Pmt Function [Runtime - VBA] PPmt Function [Runtime - VBA] +PV Function [Runtime - VBA] Print Statement [Runtime] Public Statement [Runtime] Put Statement [Runtime] diff --git a/source/text/sbasic/shared/03140009.xhp b/source/text/sbasic/shared/03140009.xhp new file mode 100644 index 0..8b8fe617f --- /dev/null +++ b/source/text/sbasic/shared/03140009.xhp @@ -0,0 +1,76 @@ + + + + + + +PV Function [Runtime - VBA] +/text/sbasic/shared/03140009.xhp + + + + + + + + + PV function + + + +PV Function [Runtime - VBA] +Returns the Present Value of an investment resulting from a series of regular payments. + + + + +Pmt( Rate as Double, NPer as Double, Pmt as Double, [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +NPer is the total number of periods, during which annuity is paid. +Pmt is the regular payment made per period. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExamplePV +' Calculate the present value of an annuity that pays $1,000 per month over 6 years. +' Interest is 10% per year and each payment is made at the end of the month. +Dim pv1 As Double +pv1 = PV( 0.1/12, 72, -1000 ) +print pv1 ' pv1 is calculated to be 53978,6654781073. +End Sub + + + +PV function in CALC + + + + + \ 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 3b5ab3017..39f33a57f 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -63,12 +63,10 @@ + -PV - - Rate ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140008.xhp | 82 + source/text/sbasic/shared/special_vba_func.xhp |4 - 4 files changed, 85 insertions(+), 3 deletions(-) New commits: commit 60d67acd3b161461bbd0f84c7e12be97553b6ebe Author: Olivier HallotDate: Sun Jul 23 23:55:04 2017 -0300 tdf#108676 Help page for VBA function PPmt Change-Id: I689c08037890630d0bb49305bec23e518bf085c8 Reviewed-on: https://gerrit.libreoffice.org/40350 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index cce356b84..e4c4d2a6d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -332,6 +332,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140005 \ helpcontent2/source/text/sbasic/shared/03140006 \ helpcontent2/source/text/sbasic/shared/03140007 \ +helpcontent2/source/text/sbasic/shared/03140008 \ 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 b089a120c..f8453e5fe 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -206,6 +206,7 @@ Optional (in Function Statement) [Runtime] Or-Operator [Runtime] Pmt Function [Runtime - VBA] +PPmt Function [Runtime - VBA] Print Statement [Runtime] Public Statement [Runtime] Put Statement [Runtime] diff --git a/source/text/sbasic/shared/03140008.xhp b/source/text/sbasic/shared/03140008.xhp new file mode 100644 index 0..c8ac0fb1e --- /dev/null +++ b/source/text/sbasic/shared/03140008.xhp @@ -0,0 +1,82 @@ + + + + + + +PPmt Function [Runtime - VBA] +/text/sbasic/shared/03140008.xhp + + + + + + + + + PPmt function + + + +PPmt Function [Runtime - VBA] +Returns for a given period the payment on the principal for an investment that is based on periodic and constant payments and a constant interest rate. + + + + +Pmt( Rate as Double, Per as Double, NPer as Double, PV as Double, [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +Per The period number for which you want to calculate the principal payment (must be an integer between 1 and Nper). +NPer is the total number of periods, during which annuity is paid. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExamplePPmt +' Calculate the principal payments during months 4 5, for a loan that is to be paid in full +' over 6 years. Interest is 10% per year and payments are made at the end of the month. +Dim ppMth4 As Double +Dim ppMth5 As Double +' Principal payment during month 4: +ppMth4 = PPmt( 0.1/12, 4, 72, 10 ) +print ppMth4 ' ppMth4 is calculated to be -1044,94463903636 +' Principal payment during month 5: +ppMth5 = PPmt( 0.1/12, 5, 72, 10 ) +print ppMth5' ppMth5 is calculated to be -1053,65251102833 +End Sub + + + +PPMT function in CALC + + + + + \ 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 bec2c7bf4..3b5ab3017 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -62,12 +62,10 @@ + -PPmt - - PV ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140007.xhp | 76 + source/text/sbasic/shared/special_vba_func.xhp |4 - 4 files changed, 79 insertions(+), 3 deletions(-) New commits: commit 7e0d91b15d875f6bf7fa94edf96a0bb791d5e8b3 Author: Olivier HallotDate: Sun Jul 23 23:30:26 2017 -0300 tdf#108675 Help page for VBA function Pmt Change-Id: I1e35ee31cd96aeee8f1b55a5adb119c50af1a1af Reviewed-on: https://gerrit.libreoffice.org/40349 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 43b6882dd..cce356b84 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -331,6 +331,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140004 \ helpcontent2/source/text/sbasic/shared/03140005 \ helpcontent2/source/text/sbasic/shared/03140006 \ +helpcontent2/source/text/sbasic/shared/03140007 \ 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 0c1cfc882..b089a120c 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -205,6 +205,7 @@ Option VBASupport Statement [Runtime] Optional (in Function Statement) [Runtime] Or-Operator [Runtime] +Pmt Function [Runtime - VBA] Print Statement [Runtime] Public Statement [Runtime] Put Statement [Runtime] diff --git a/source/text/sbasic/shared/03140007.xhp b/source/text/sbasic/shared/03140007.xhp new file mode 100644 index 0..65e3a784c --- /dev/null +++ b/source/text/sbasic/shared/03140007.xhp @@ -0,0 +1,76 @@ + + + + + + +Pmt Function [Runtime - VBA] +/text/sbasic/shared/03140007.xhp + + + + + + + + + Pmt function + + + +Pmt Function [Runtime - VBA] +Calculates the constant periodic payments for a loan or investment. + + + + +Pmt( Rate as Double, NPer as Double , PV as Double , [FV as Variant], [Due as Variant] ) + + +Double + +Rate is the periodic interest rate. +NPer is the total number of periods, during which annuity is paid. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + +REM * BASIC * +Option VBASUPPORT 1 +' Calculate the monthly payments to a loan that is to be paid in full over 6 years. +' Interest is 10% per year and payments are made at the end of the month. +Sub ExamplePmt + Dim myPmt As Double + myPmt = Pmt( 0.1/12, 72, 10 ) + print MyPmt 'is calculated to be -1852,58377757705 +End Sub + + + +PMT function in CALC + + + + + \ 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 685511912..bec2c7bf4 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -61,12 +61,10 @@ + -Pmt - - PPmt ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
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 HallotDate: 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 Tested-by: Olivier Hallot 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 @@ Not-Operator [Runtime] Now Function [Runtime] NPer Function [Runtime - VBA] +NPV Function [Runtime - VBA] Numeric Functions Oct Function [Runtime] On Error GoTo ... Resume Statement [Runtime] diff --git a/source/text/sbasic/shared/03140006.xhp b/source/text/sbasic/shared/03140006.xhp new file mode 100644 index 0..dc4786464 --- /dev/null +++ b/source/text/sbasic/shared/03140006.xhp @@ -0,0 +1,77 @@ + + + + + + +NPV Function [Runtime - VBA] +/text/sbasic/shared/03140006.xhp + + + + + + + + + NPV function + + + +NPV Function [Runtime - VBA] +Calculates the Net Present Value of an investment, based on a supplied discount rate, and a series of deposits and withdrawals. + + + + +NPV (Rate as Double, Values() as Double) + + +Double + +Rate is the discount rate for a period. +Values() is an array that represent deposits (positive values) or withdrawals (negative values). + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExampleNPV + Dim r As Double + Dim pValues(5) as Double + pValues(0) = 100 + pValues(1) = 100 + pValues(2) = 100 + pValues(3) = -300 + pValues(4) = 100 + pValues(5) = 100 + r = 0.06 + p = NPV( r, pValues) + Print p ' returns 174,894967305331 +End Sub + + + +NPV function in CALC + + + + + 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 @@ + -NPV - - Pmt @@ -135,4 +133,4 @@ - \ No newline at end of file + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140005.xhp | 78 + source/text/sbasic/shared/special_vba_func.xhp |2 4 files changed, 81 insertions(+), 1 deletion(-) New commits: commit 1a2f0ac70b638ac316e081ba2b72309829f00fcc Author: Olivier HallotDate: Fri Jun 16 18:29:59 2017 -0300 tdf#84675 Add help page for NPer function of VBA Change-Id: Id601138bc4ad390f8ec6c14fe41dc1f936ab5aab Reviewed-on: https://gerrit.libreoffice.org/38902 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 6ef725554..405556ea8 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -329,6 +329,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140002 \ helpcontent2/source/text/sbasic/shared/03140003 \ helpcontent2/source/text/sbasic/shared/03140004 \ +helpcontent2/source/text/sbasic/shared/03140005 \ 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 b690cf868..a0085f6a3 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -193,6 +193,7 @@ Name Statement [Runtime] Not-Operator [Runtime] Now Function [Runtime] +NPer Function [Runtime - VBA] Numeric Functions Oct Function [Runtime] On Error GoTo ... Resume Statement [Runtime] diff --git a/source/text/sbasic/shared/03140005.xhp b/source/text/sbasic/shared/03140005.xhp new file mode 100644 index 0..e46c2b9c4 --- /dev/null +++ b/source/text/sbasic/shared/03140005.xhp @@ -0,0 +1,78 @@ + + + + + + +NPer Function [Runtime - VBA] +/text/sbasic/shared/03140005.xhp + + + + + + + + + NPer function + + + +NPer Function [Runtime - VBA] +Calculates the number of periods for a loan or investment. + + + + + +NPer (Rate as Double, Pmt as Double, PV as Double, [FV as Variant], [Due as Variant]) + + + +Double + + +Rate is the periodic interest rate. +Pmt is the annuity paid regularly per period. +PV is the (present) cash value of an investment. +FV (optional) is the future value of the loan / investment. +Due (optional) defines whether the payment is due at the beginning or the end of a period. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExampleNPer + Dim period As Double + period = NPer( 0.06, 153.75, 2600) + Print period ' returns -12,02. The payment period covers 12.02 periods. +End Sub + + + +NPER 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 e4101b8f5..550395d4c 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -82,7 +82,7 @@ MIRR -NPer +NPer NPV ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140004.xhp | 78 + source/text/sbasic/shared/special_vba_func.xhp |4 - 4 files changed, 82 insertions(+), 2 deletions(-) New commits: commit 139a1c699caadd5365e335a432ffd5fdad8d73de Author: Olivier HallotDate: Fri Jun 16 17:38:23 2017 -0300 tdf#84675 Add help page for MIRR function of VBA Change-Id: I7b55b4994a1c65b714be3ad4114aee9233502276 Reviewed-on: https://gerrit.libreoffice.org/38897 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 731bb7d46..6ef725554 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -328,6 +328,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140001 \ helpcontent2/source/text/sbasic/shared/03140002 \ helpcontent2/source/text/sbasic/shared/03140003 \ +helpcontent2/source/text/sbasic/shared/03140004 \ 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 d95a88c48..b690cf868 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -184,6 +184,7 @@ Log Function [Runtime] Mid Function, Mid Statement [Runtime] Minute Function [Runtime] +MIRR Function [Runtime - VBA] MkDir Statement [Runtime] Mod-Operator [Runtime] Month Function [Runtime] diff --git a/source/text/sbasic/shared/03140004.xhp b/source/text/sbasic/shared/03140004.xhp new file mode 100644 index 0..710b834ca --- /dev/null +++ b/source/text/sbasic/shared/03140004.xhp @@ -0,0 +1,78 @@ + + + + + + +MIRR Function [Runtime - VBA] +/text/sbasic/shared/03140004.xhp + + + + + + + + + MIRR function + + + +MIRR Function [Runtime - VBA] +Calculates the modified internal rate of return of a series of investments. + + + + + +MIRR(Values() as Double, Investment as Double, ReinvestRate as Double) + + + +Double + + +Values(): An array of cash flows, representing a series of payments and income, where negative values are treated as payments and positive values are treated as income. This array must contain at least one negative and at least one positive value. +Investment: is the rate of interest of the investments (the negative values of the array). +ReinvestRate: the rate of interest of the reinvestment (the positive values of the array). + + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExampleMIRR + Dim cashFlow(0 to 3) As Double + cashFlow(0) = -5 + cashFlow(1) = 10 + cashFlow(2) = 15 + cashFlow(3) = 8 + mirrValue = MIRR(cashFlow,0.5,0.1) * 100 + Print mirrValue ' returns 94.16. The modified internal rate of return of the cash flow. +End Sub + + + +MIRR 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 12d68f22e..e4101b8f5 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -79,7 +79,7 @@ IRR -MIRR +MIRR NPer @@ -157,4 +157,4 @@ - \ No newline at end of file + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk |1 source/auxiliary/sbasic.tree |1 source/text/sbasic/shared/03140003.xhp | 77 + source/text/sbasic/shared/special_vba_func.xhp |2 4 files changed, 80 insertions(+), 1 deletion(-) New commits: commit 23d9c94939bb42e08f5e21579748e00dde514073 Author: Olivier HallotDate: Fri Jun 16 16:54:14 2017 -0300 tdf#84675 Add help page for IRR function of VBA Change-Id: If4218b4b9619766e25676d5c4be35db42d51b007 Reviewed-on: https://gerrit.libreoffice.org/38896 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d2435e002..731bb7d46 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -327,6 +327,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/0314 \ helpcontent2/source/text/sbasic/shared/03140001 \ helpcontent2/source/text/sbasic/shared/03140002 \ +helpcontent2/source/text/sbasic/shared/03140003 \ 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 9448d6587..d95a88c48 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -160,6 +160,7 @@ Input# Statement [Runtime] Int Function [Runtime] IPmt Function [Runtime - VBA] +IRR Function [Runtime - VBA] IsArray Function [Runtime] IsDate Function [Runtime] IsEmpty Function [Runtime] diff --git a/source/text/sbasic/shared/03140003.xhp b/source/text/sbasic/shared/03140003.xhp new file mode 100644 index 0..cd5fc6f75 --- /dev/null +++ b/source/text/sbasic/shared/03140003.xhp @@ -0,0 +1,77 @@ + + + + + + +IRR Function [Runtime - VBA] +/text/sbasic/shared/03140003.xhp + + + + + + + + + IRR function + + + +IRR Function [Runtime - VBA] +Calculates the internal rate of return for an investment. + + + + + +IRR(Values() as Double , [Guess as Variant]) + + + +Double + + +Values(): The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income). +Guess An initial estimate at what the IRR will be. + + + + + +REM * BASIC * +Option VBASupport 1 +Sub ExampleIRR + Dim cashFlow(0 to 3) As Double + cashFlow(0) = -1 + cashFlow(1) = 3500 + cashFlow(2) = 7600 + cashFlow(3) = 1000 + irrValue = IRR(cashFlow) * 100 + Print irrValue ' returns 11.3321028236252 . The internal rate of return of the cash flow. +End Sub + + + +IRR 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 582e2ce0e..12d68f22e 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -76,7 +76,7 @@ IPmt -IRR +IRR MIRR ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/auxiliary source/text
AllLangHelp_sbasic.mk|1 source/auxiliary/sbasic.tree |1 source/text/sbasic/guide/access2base.xhp | 97 +++ 3 files changed, 99 insertions(+) New commits: commit db8f7521f190f41bc80b783183a9cff5b98f4c16 Author: Jean-Pierre Ledure j...@ledure.be Date: Sat Nov 2 11:30:34 2013 +0100 Access2Base - Help file Summary description + reference to official doc site 1 entry in index 1 entry in Macros Programming - Guides Change-Id: I26587292b4daff035779fc197522af7dc600279a Reviewed-on: https://gerrit.libreoffice.org/6522 Tested-by: Lionel Elie Mamane lio...@mamane.lu Reviewed-by: Lionel Elie Mamane lio...@mamane.lu diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c03b371..156b542 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -16,6 +16,7 @@ $(eval $(call gb_AllLangHelp_use_linked_modules,sbasic,\ )) $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ +helpcontent2/source/text/sbasic/guide/access2base \ helpcontent2/source/text/sbasic/guide/control_properties \ helpcontent2/source/text/sbasic/guide/create_dialog \ helpcontent2/source/text/sbasic/guide/insert_control \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 0e39d32..136439b 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -264,6 +264,7 @@ topic id=sbasic/text/sbasic/shared/01020200.xhpUsing Objects/topic topic id=sbasic/text/sbasic/shared/01030300.xhpDebugging a Basic Program/topic topic id=sbasic/text/sbasic/shared/0104.xhpEvent-Driven Macros/topic +topic id=sbasic/text/sbasic/guide/access2base.xhpAccess2Base, the API for Base users/topic /node /help_section /tree_view diff --git a/source/text/sbasic/guide/access2base.xhp b/source/text/sbasic/guide/access2base.xhp new file mode 100644 index 000..135adc5 --- /dev/null +++ b/source/text/sbasic/guide/access2base.xhp @@ -0,0 +1,97 @@ +?xml version=1.0 encoding=UTF-8? + + + +!-- +=== +=== The Access2Base library is a part of the LibreOffice project. === +=== Full documentation is available on http://www.access2base.com === +=== + + Access2Base is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Access2Base is free software; you can redistribute it and/or modify it under the terms of either (at your option): + + 1) 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/ . + + 2) The GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. If a copy of the LGPL was not + distributed with this file, see http://www.gnu.org/licenses/ . + -- + + +helpdocument version=1.0 +meta + topic id=textsbasicsharedA2B001xml indexer=include status=PUBLISH + title id=tit xml-lang=en-USAccess2Base/title + filename/text/sbasic/guide/access2base.xhp/filename + history + created date=2013-11-01T00:00:00Access2Base topic first insertion, by Jean-Pierre Ledure/created + lastedited date=2013-11-01T00:00:00None/lastedited + /history + /topic +/meta +body + bookmark xml-lang=en-US branch=index id=bm_idA2B001bookmark_valueAccess2Base/bookmark_value + /bookmark + paragraph role=heading id=hd_idA2B002 xml-lang=en-US level=1 l10n=UAccess2Base/paragraph + paragraph role=heading id=hd_idA2B003 xml-lang=en-US level=2 l10n=UWhat is Access2Base ?/paragraph + paragraph role=paragraph id=par_idA2B004 xml-lang=en-US l10n=UAccess2Base is a LibreOffice Basic library of macros for (business or personal) application developers and advanced users. It is one of the libraries stored in LibreOffice macros and dialogs./paragraph + paragraph role=paragraph id=par_idA2B005 xml-lang=en-US l10n=UThe provided macros implement functionalities, all directly inspired by Microsoft Access. The macros are callable from a LibreOffice emphBase/emph application only./paragraph + paragraph role=paragraph id=par_idA2B006 xml-lang=en-US l10n=UThe API provided by Access2Base is intended to be more concise, intuitive and easy to learn than the standard UNO API (API = Application Programming Interface)./paragraph + br/ + paragraph role=warning id=par_idA2B007 xml-lang=en-US l10n=UemphThe library is documented online on link href=http://www.access2base.com;