help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk | 19 +++ source/text/sbasic/shared/exportasfixedformat.xhp | 59 ++ source/text/sbasic/shared/special_vba_func.xhp| 23 3 files changed, 81 insertions(+), 20 deletions(-) New commits: commit c8ef32e905f028ee451b3664f72c0b508c74c6c5 Author: Olivier Hallot AuthorDate: Sun Mar 24 17:41:40 2024 -0300 Commit: Olivier Hallot CommitDate: Mon Mar 25 12:54:35 2024 +0100 tdf#159725 ExportAsFixedFormat Help page (WIP) Initial Help page for ExportAsFixedFormat VBA method. Missing: - Error codes related - Arguments not implemented Change-Id: I43ca670047542b29858e4384243d7e9a36a5efc0 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/165256 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c4c51f9b1a..00484ce127 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -400,8 +400,6 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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 \ helpcontent2/source/text/sbasic/shared/calc_functions \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/CallByName \ @@ -413,23 +411,26 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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/doEvents \ +helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/ErrVBA \ +helpcontent2/source/text/sbasic/shared/exportasfixedformat \ helpcontent2/source/text/sbasic/shared/fragments \ -helpcontent2/source/text/sbasic/shared/partition \ -helpcontent2/source/text/sbasic/shared/property \ -helpcontent2/source/text/sbasic/shared/replace \ -helpcontent2/source/text/sbasic/shared/uno_objects \ -helpcontent2/source/text/sbasic/shared/stardesktop \ -helpcontent2/source/text/sbasic/shared/thisdbdoc \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ +helpcontent2/source/text/sbasic/shared/is_keyword \ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ helpcontent2/source/text/sbasic/shared/main0601 \ +helpcontent2/source/text/sbasic/shared/new_keyword \ +helpcontent2/source/text/sbasic/shared/partition \ +helpcontent2/source/text/sbasic/shared/property \ +helpcontent2/source/text/sbasic/shared/replace \ helpcontent2/source/text/sbasic/shared/Resume \ helpcontent2/source/text/sbasic/shared/special_vba_func \ +helpcontent2/source/text/sbasic/shared/stardesktop \ helpcontent2/source/text/sbasic/shared/strconv \ +helpcontent2/source/text/sbasic/shared/thisdbdoc \ +helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/vbasupport \ helpcontent2/source/text/sbasic/python/main \ helpcontent2/source/text/sbasic/python/python_2_basic \ diff --git a/source/text/sbasic/shared/exportasfixedformat.xhp b/source/text/sbasic/shared/exportasfixedformat.xhp new file mode 100644 index 00..2705c8c865 --- /dev/null +++ b/source/text/sbasic/shared/exportasfixedformat.xhp @@ -0,0 +1,59 @@ + + + + + + +ExportAsFixedFormat +/text/sbasic/shared/exportasfixedformat.xhp + + + + +ExportAsFixedFormat method [VBA] + + +ExportAsFixedFormat Method [VBA] +Method to export a Calc document to PDF format. + + + + + +expression.ExportAsFixedFormat (Type, Filename, Quality, IncludeDocProperties, IgnorePrintAreas, From, To, OpenAfterPublish) +Type: Integer, required. Can be either 0 or 1. 0 for "PDF" - Portable Document Format file (.pdf) and 1 for "XPS" - XPS Document (.xps) +XPS export format is not supported by %PRODUCTNAME. +Filename: String, optional. The file name of the exported file. +Quality: Integer, optional. Can be 0 or 1. 0 is for standard quality, 1 is for minimum quality. +IncludeDocProperties: Boolean, optional. Set to True to indicate that document properties should be included in the exported file, or set to False to suppress the export of document properties. +IgnorePrintAreas: Boolean, optional. If set to True, ignores any print ranges on export. If set to False, honor the print ranges on export. +From:Integer, optional. Page number of the first page to export. If omitted, export starts at the beginning. +To: Integer, opt
help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/color_scheme.xhp | 52 + source/text/shared/optionen/01012000.xhp |2 - 3 files changed, 54 insertions(+), 1 deletion(-) New commits: commit b85bb4516175e71903a9c5db583724231fa60471 Author: Rafael Lima AuthorDate: Tue Jan 9 20:55:08 2024 +0100 Commit: Olivier Hallot CommitDate: Wed Jan 10 15:29:29 2024 +0100 tdf#156925 Document the Color Scheme dialog Change-Id: Ida045c1f2884b70b1f9a961eb2c17e8553b8f25b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/161850 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 8f89b33ffb..c4c51f9b1a 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -407,6 +407,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/CallByName \ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/collection \ +helpcontent2/source/text/sbasic/shared/color_scheme \ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/Compiler_options \ diff --git a/source/text/sbasic/shared/color_scheme.xhp b/source/text/sbasic/shared/color_scheme.xhp new file mode 100644 index 00..14b5795f40 --- /dev/null +++ b/source/text/sbasic/shared/color_scheme.xhp @@ -0,0 +1,52 @@ + + + + + + +Color Scheme +/text/sbasic/shared/color_scheme.xhp + + + + + +Basic IDE;Color schemes + + + + Color Scheme + Changes the color scheme to be used in the Basic IDE code editor. + + +Choose View - Color Scheme. + + + Basic IDE Color Options + Choose whether to use the Application Colors or a specific color scheme: + + + Use Application Colors: Select this option to use the colors defined in the Application Colors dialog. + + + Choose Color Scheme: Select this option to use one of the available color schemes in the dialog. + + + + Color Schemes + Lists the available color schemes that can be applied to the Basic IDE code editor. + When the option Choose Color Scheme is selected, the list of color schemes is enabled. Choose one of the available color schemes and click OK to apply it. + New color schemes can be installed via extensions. Visit the https://extensions.libreoffice.org";>Extensions website to download additional Basic IDE color schemes. + + + + + + diff --git a/source/text/shared/optionen/01012000.xhp b/source/text/shared/optionen/01012000.xhp index 906e19e736..1def34b67d 100644 --- a/source/text/shared/optionen/01012000.xhp +++ b/source/text/shared/optionen/01012000.xhp @@ -38,7 +38,7 @@ -Application Colors +Application Colors Sets the colors for the $[officename] user interface. You can save the current settings as color scheme and load them later.
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_region.xhp | 605 +++ 3 files changed, 611 insertions(+), 1 deletion(-) New commits: commit 4b84d252a9a17f0428ac4c7c555b4df92a54306a Author: Rafael Lima AuthorDate: Fri Jun 24 16:02:02 2022 +0200 Commit: Jean-Pierre Ledure CommitDate: Thu Jun 30 12:18:17 2022 +0200 Document the new Region service in ScriptForge Change-Id: Ic7869d6c21fdcbbd3a2a9631647d115654adf889 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/136388 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index fa1952c19..4114c5a6f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -100,6 +100,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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_region \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 4a257e4b1..35190c42d 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -139,11 +139,12 @@ Basic L10N + Platform - Platform + Region Services @@ -209,6 +210,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_region.xhp b/source/text/sbasic/shared/03/sf_region.xhp new file mode 100644 index 0..9abf7a130 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_region.xhp @@ -0,0 +1,605 @@ + + + + + +ScriptForge.Region service +/text/sbasic/shared/03/sf_region.xhp + + + + + +Region service + + + + ScriptForge.Region service + The Region service provides a collection of properties and methods to handle locale and region-related aspects of programming, such as: + + + Accessing locale and region-dependent settings such as number formatting, currency and timezones. + + + Converting timezones and calculate Daylight Saving Time (DST) offsets. + + + Transforming numbers into text in any supported language. + + + + + Definitions + Locale or Region + A string combining a language and a country in the format "la-CO". The language part is expressed with 2 or 3 lowercase characters followed by a dash and 2 uppercase characters representing the country. + For instance, "en-US" corresponds to the English language in the United States; "fr-BE" corresponds to the French language in Belgium, and so forth. + On some situations the full locale is not required and only the language or country may be specified. + Most properties and methods accept a locale as argument. If no locale is specified, then the user-interface locale is used, which is defined in the OfficeLocale property of the Platform service. + Timezone + A string in the format "Region/City" such as "Europe/Berlin", or a timezone ID such as "UTC" or "GMT-8:00". Refer to the wiki page https://wikipedia.org/wiki/List_of_tz_database_time_zones"; name="TimeZones_List">List of tz database and timezones for a list of possible timezone names and IDs. + Providing an invalid timezone string to any of the methods in the Region service will not result in a runtime error. Instead, methods as UTCDateTime and UTCNow will return the current operating system date and time. + The time offset between the timezone and the Greenwich Meridian Time (GMT) is expressed in minutes. + The Daylight Saving Time (DST) is an additional offset. + The timezone and DST offsets may be positive or negative. + + Service invocation + Before using the Region service the ScriptForge library needs to be loaded or imported: + + The examples below in Basic and Python instantiate the Region service and access the Country property. + + +GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") +Dim oRegion As Variant +oRegion = CreateScriptService("Region") +MsgBox oRegion.Country("en-US") ' United States + + + +from scriptforge import CreateScriptService +oRregion = CreateScriptService("Region") +bas = CreateScriptService("Basic") +bas.MsgBox(oRegion.Country("en-US")) + + + +Region service;Country +Region service;Currency +Region service;DatePatterns +Region service;DateSeparator +Region service;DayAbbrevNames +Region service;DayNames +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/python/main.xhp |1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |1 source/text/sbasic/shared/03/sf_intro.xhp| 181 +++ source/text/shared/guide/start_parameters.xhp|2 5 files changed, 185 insertions(+), 1 deletion(-) New commits: commit 38ce99f8010aed59242b817b866055407f22cefb Author: Rafael Lima AuthorDate: Fri Jun 11 03:16:26 2021 +0200 Commit: Rafael Lima CommitDate: Fri Jun 11 22:42:55 2021 +0200 Create introductory ScriptForge help page Change-Id: I5fd00cc05b0c28b600974c005a81804c1c6d5e74 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116906 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c2d750049..b1e748258 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -91,6 +91,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_intro \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ helpcontent2/source/text/sbasic/shared/03/sf_session \ diff --git a/source/text/sbasic/python/main.xhp b/source/text/sbasic/python/main.xhp index f90781ba0..76a4e2589 100644 --- a/source/text/sbasic/python/main.xhp +++ b/source/text/sbasic/python/main.xhp @@ -39,6 +39,7 @@ + diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 15eb73a56..86f12534c 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -27,6 +27,7 @@ • Basic macros require to load ScriptForge library using the following statement: GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")• Python scripts require an import from scriptforge module: from scriptforge import CreateScriptService +To learn more about how to create and execute Python scripts using the ScriptForge library, read the help page. The described modules and classes are invoked from user scripts as "Services". A generic constructor of those services has been designed for that purpose for each language: GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") diff --git a/source/text/sbasic/shared/03/sf_intro.xhp b/source/text/sbasic/shared/03/sf_intro.xhp new file mode 100644 index 0..525e2680d --- /dev/null +++ b/source/text/sbasic/shared/03/sf_intro.xhp @@ -0,0 +1,181 @@ + + + + + + +Creating Python Scripts with ScriptForge +/text/sbasic/shared/03/sf_intro.xhp + + + + + +Python scripts with ScriptForge + + Creating Python Scripts with ScriptForge + Differences between Basic and Python + The ScriptForge library is available both for Basic and Python. Most services, methods and properties work identically in both programming languages. However, due to differences in how each language works, ScriptForge users must be aware of some characteristics of the library when using Python: + + + Methods and Property names: In Python, all methods and properties can be used in lowercased, ProperCased or camelCased formats. + + +Arguments: All keyword arguments passed on to methods are lowercased. + + +Dates: All date objects are passed and returned as datetime.datetime native Python objects. + + + Arrays: One-dimensional arrays are passed and returned as tuples (which is an immutable object). Two-dimensional arrays are passed and returned as tuples of tuples. + + + None: Python's None keyword is equivalent to Basic's Null, Empty or Nothing. + + + UNO objects: All UNO structures are exchanged between Basic and Python without any changes. + + + Debugging: Whenever an error occurs in Python scripts that use ScriptForge, the error message provided by the Python execution stack displays the line of code that triggered the error. In Basic error messages do not display this information. + + + Visit for more information on Python scripting using %PRODUCTNAME. + Running Python scripts on %PRODUCTNAME + Depending on what you intend to achieve, you may choose one of the following approaches to running Python scripts in %PRODUCTNAME: + + + Run Scripts inside the current %PRODUCTNAME process: Python scripts are executed from within the %PRODUCTNAME process by using the Tools - Macros - Run Macro menu or the APSO extension to call user scripts stored in the Python scripts folder. You can also use the APSO Python shell to interactively run Python scripts.
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 31 ++- 2 files changed, 21 insertions(+), 11 deletions(-) New commits: commit 6b24e1b46b633ccbbf65159f858c9a496479e426 Author: Alain Romedenne AuthorDate: Thu Apr 29 18:17:27 2021 +0200 Commit: Rafael Lima CommitDate: Fri Apr 30 22:14:29 2021 +0200 sf_basic.xhp pt. 2 Change-Id: Icb81fca7bdea283d3da6c113d1305d47c5bc6ff3 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/114867 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 84f2b3859..0f7e60542 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -80,6 +80,7 @@ $(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_base \ +helpcontent2/source/text/sbasic/shared/03/sf_basic \ helpcontent2/source/text/sbasic/shared/03/sf_calc \ helpcontent2/source/text/sbasic/shared/03/sf_database \ helpcontent2/source/text/sbasic/shared/03/sf_dialog \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index dc3c9674f..f3aa899f2 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -15,22 +15,28 @@ -The ScriptForge Library +The ScriptForge Library BASIC ScriptForge library - -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 libraries build up an extensible collection of macro scripting resources for %PRODUCTNAME to be invoked from Basic macros or Python scripts. +• Basic macros require to load ScriptForge library using the following statement: GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")• Python scripts require an import from scriptforge module: + from scriptforge import CreateScriptService + +The described modules and classes are invoked from user scripts as "Services". A generic constructor of those services has been designed for that purpose for each language: - CreateScriptService("servicename"[, arg0, Arg1, ...]) + GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") + Set oSvc = CreateScriptService("servicename"[, arg0, arg1, ...]) -Services from external libraries can be registered with the RegisterScriptServices(...) method in order to extend the set of available services. -The ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. - + + from scriptforge import CreateScriptService + svc = CreateScriptService('servicename'[, arg0, arg1, ...]) + + +The ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards.Python scriptforge module is available from %PRODUCTNAME 7.2 onwards. Services provided by the ScriptForge library @@ -70,13 +76,14 @@ Base + Basic Calc Database - Document + Document Form FormControl @@ -116,13 +123,15 @@ - + + + @@ -183,4 +192,4 @@ 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 ___ 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/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_base.xhp | 228 +++ source/text/sbasic/shared/03/sf_database.xhp |3 4 files changed, 236 insertions(+), 2 deletions(-) New commits: commit c8cf56ede34cc13a90a930aab505828ee196005c Author: Rafael Lima AuthorDate: Fri Apr 23 16:23:19 2021 +0200 Commit: Rafael Lima CommitDate: Thu Apr 29 16:22:32 2021 +0200 Create SFDocuments.Base service help page Change-Id: I2bf6bb4e28ed4390c26f94092aabd1dc878a Reviewed-on: https://gerrit.libreoffice.org/c/help/+/114509 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 0b8165024..84f2b3859 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -79,6 +79,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_script \ helpcontent2/source/text/sbasic/shared/03/lib_ScriptForge \ helpcontent2/source/text/sbasic/shared/03/sf_array \ +helpcontent2/source/text/sbasic/shared/03/sf_base \ helpcontent2/source/text/sbasic/shared/03/sf_calc \ helpcontent2/source/text/sbasic/shared/03/sf_database \ helpcontent2/source/text/sbasic/shared/03/sf_dialog \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index d08f47d41..dc3c9674f 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -69,13 +69,14 @@ + Base Calc Database - Document + Document Form FormControl @@ -119,6 +120,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_base.xhp b/source/text/sbasic/shared/03/sf_base.xhp new file mode 100644 index 0..e59da8cbd --- /dev/null +++ b/source/text/sbasic/shared/03/sf_base.xhp @@ -0,0 +1,228 @@ + + + + + + +SFDocuments.Base service +/text/sbasic/shared/03/sf_base.xhp + + + + + + +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: + + +Get access to the database contained in a Base document. + + +Open form documents stored in a Base document. + + +Check if a form document from a Base document is currently loaded. + + + + + + Refer to the Document service to learn more about methods and properties that can be used to manage %PRODUCTNAME documents. + + Service invocation + The Base service can be invoked in a variety of ways. The code snippet below uses the method CreateBaseDocument from the UI service to create a new Base file. + Note that in all examples the object oDoc is an instance of the Base service. + +Dim ui As Object, oDoc As Object +Set ui = CreateScriptService("UI") +Set oDoc = ui.CreateBaseDocument("C:\Documents\MyFile.odb") + + The Base service can also be instantiated while opening an existing Base file, as shown below: + +Set oDoc = ui.OpenBaseDocument("C:\Documents\MyFile.odb") + + If a Base document is already open, it is possible to instantiate the Base service directly: + +Dim oDoc As Object +Set oDoc = CreateScriptService("SFDocuments.Document", "MyFile.odb") + + The use of the "SFDocuments." substring in the previous example is optional. + + + + + List of Methods in the Base Service + + + + + + FormDocuments + Forms + + + + + GetDatabase + IsLoaded + + + + + OpenFormDocument + + + + + + + FormDocuments --- + +Base service;FormDocuments + + FormDocuments + Returns an array with the full names (path/name) of all form documents in the Base document as an zero-based Array of strings. + + +oDoc.FormDocuments() As Variant + + + The code snippet below prints the names of all form documents in the current Base document. + +Dim oDoc as Object, myForms as Object, formName as String +Set oDoc = CreateScriptService("Document", ThisDataBaseDocument) +Set myForms = oDoc.Fo
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/avail_release.xhp |4 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_form.xhp |1 source/text/sbasic/shared/03/sf_formcontrol.xhp | 1136 +++ 5 files changed, 1145 insertions(+), 3 deletions(-) New commits: commit bb496ca3d2da2fd0846cd56cfde58a584e512c47 Author: Rafael Lima AuthorDate: Sun Apr 18 21:08:59 2021 +0200 Commit: Rafael Lima CommitDate: Fri Apr 23 16:22:19 2021 +0200 Create FormControl service help page Change-Id: I32ec1a4509e5d59b73696ac25a4a757d055dfb70 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/114186 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 08b2006f0..0b8165024 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -88,6 +88,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_exception \ 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_l10n \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ helpcontent2/source/text/sbasic/shared/03/sf_session \ diff --git a/source/text/sbasic/shared/03/avail_release.xhp b/source/text/sbasic/shared/03/avail_release.xhp index a7666f637..29f4bd1f4 100644 --- a/source/text/sbasic/shared/03/avail_release.xhp +++ b/source/text/sbasic/shared/03/avail_release.xhp @@ -21,10 +21,10 @@ This property is not available in Basic. This method is not available in Python. This property is not available in Python. - + These methods are available from %PRODUCTNAME 7.2 onwards. diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 4c5b846c7..d08f47d41 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -76,7 +76,8 @@ - Form + Form + FormControl @@ -145,6 +146,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_form.xhp b/source/text/sbasic/shared/03/sf_form.xhp index e531105c6..47847b0bc 100644 --- a/source/text/sbasic/shared/03/sf_form.xhp +++ b/source/text/sbasic/shared/03/sf_form.xhp @@ -113,6 +113,7 @@ '(...) End sub + Properties diff --git a/source/text/sbasic/shared/03/sf_formcontrol.xhp b/source/text/sbasic/shared/03/sf_formcontrol.xhp new file mode 100644 index 0..b7cff9eca --- /dev/null +++ b/source/text/sbasic/shared/03/sf_formcontrol.xhp @@ -0,0 +1,1136 @@ + + + + + + +SFDocuments.FormControl service +/text/sbasic/shared/03/sf_formcontrol.xhp + + + + + + + FormControl service + + + + + SFDocuments.FormControl service + The FormControl service provides access to the controls that belong to a form, a subform or a table control of a FormDocument. Each instance of the FormControl service refers to a single control in the form. This service allows users to: + + +Get and set the properties of the control represented by the FormControl instance. + + +Access the current value displayed by the control. + + +Set the focus on the desired control. + + + + To use the FormControl service in a particular form, subform or table control, all controls must have unique names. + Radio buttons that share the same group name must also have unique control names. + The main purpose of the FormControl service is setting and getting the properties and values displayed by the controls in a form. + All controls have a Value property. However, its contents will vary according to the control type. For more information, read The Value Property below. + It is also possible to format the controls via the XControlModel and XControlView properties. + The SFDocuments.FormControl service is closely related to the SFDocuments.Form service. + + + API;awt.XControl + API;awt.XControlModel + + + Service invocation + The FormControl service is invoked from an existing Form service instance through its Controls method. + + Dim oDoc as Object, myForm As Object, myControl As Object + Set oDoc = CreateScriptService("SFDocuments.Document", ThisDataBaseDocument) + Set myForm = oDoc.Forms("formDocumentName", "formName") + Set myControl = myForm.Controls("myTextBox") + myControl.Value = "Current time = " & Now() + + To learn more about how to open a FormDocument and get access to its forms, refer to the SFDocuments.Form service help page. +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |7 source/text/sbasic/shared/03/sf_form.xhp | 787 +++ 3 files changed, 794 insertions(+), 1 deletion(-) New commits: commit 2280caa5f5cf639b5c9f71797dfab0749fa29639 Author: Rafael Lima AuthorDate: Mon Apr 12 14:40:35 2021 +0200 Commit: Olivier Hallot CommitDate: Wed Apr 14 13:23:34 2021 +0200 Create SFDocuments.Form help page Change-Id: I7726950a477e94b91050180db318752e6a98d434 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113993 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c1bae31bb..08b2006f0 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -87,6 +87,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_document \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ +helpcontent2/source/text/sbasic/shared/03/sf_form \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ helpcontent2/source/text/sbasic/shared/03/sf_platform \ helpcontent2/source/text/sbasic/shared/03/sf_session \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 70506e1be..4c5b846c7 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -75,7 +75,9 @@ - + + Form + @@ -140,6 +142,9 @@ + + + diff --git a/source/text/sbasic/shared/03/sf_form.xhp b/source/text/sbasic/shared/03/sf_form.xhp new file mode 100644 index 0..2ca860c7a --- /dev/null +++ b/source/text/sbasic/shared/03/sf_form.xhp @@ -0,0 +1,787 @@ + + + + + +SFDocuments.Form service +/text/sbasic/shared/03/sf_form.xhp + + + + + + Form service + + + + SFDocuments.Form service + The Form service provides methods and properties to manage forms in %PRODUCTNAME documents. This service supports forms in Base, Calc and Writer documents and allows to: + + +Open and activate forms. + + +Navigate through records shown by the form. + + +Get access to the controls inside the form. + + +Get access to subforms of a parent form. + + + + The SFDocuments.Form service is available from %PRODUCTNAME 7.2 onwards. + Forms are usually used in %PRODUCTNAME documents to create user interfaces connected to relational databases. Hence, the Form service provides quick access to the linked database through the SFDatabases.Database service. + The SFDocuments.Form service is closely related to the SFDocuments.FormControl service. + + Definitions + FormDocument + Forms are usually created in Base documents, but they can be added to Writer and Calc documents as well. The way a FormDocument is handled depends on the %PRODUCTNAME component where it is stored. + In Base, each form you create using the Insert - Form functionality or through the Form Wizard is actually a FormDocument that can be handled with the Form service. Base documents can contain an unlimited number of form documents. + Below is an example showing the hierarchy of all the elements involved in accessing forms and subforms in a Base document. Suppose you have a Base file named Employees.odb and inside it you created a form document to add new employees to the database. The form document contains a main form named EmployeeData that gives access to a table. There is also a subform WorksAtPlant that allows you to associate the new employee to one of the plants of the company. + +Employees.odb (Base document) + | + |-- AddEmployee (FormDocument) + | + |-- EmployeeData (Main Form) + | + |-- WorksAtPlant (SubForm) + + A FormDocument can be seen as a set of forms that provide access to datasets such as database tables and queries from within %PRODUCTNAME documents. The names of forms and subforms inside a FormDocument can be accessed using the Form Navigator. + In Calc documents, each sheet can contain a single FormDocument. A Writer document contains only one FormDocument, which is the document itself. + + Forms and Subforms + A form document is composed of one or more forms which, in turn, may also contain any number of subforms. A Form is an abstract set of controls that are linked to a specified data source, which can be a database table, a query or a SQL SELECT statement. + In Calc and Writer documents, each form can be linked to datasets located in different databases. On the other hand, in Base documents the database contained in the document
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/03/avail_release.xhp| 45 + source/text/sbasic/shared/03/sf_dialog.xhp| 190 ++-- source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 506 +++--- 4 files changed, 650 insertions(+), 92 deletions(-) New commits: commit ee7094d416ec829e7281b6a5dab0aea1d21acf59 Author: Alain Romedenne AuthorDate: Wed Feb 17 16:07:30 2021 +0100 Commit: Rafael Lima CommitDate: Mon Mar 22 17:53:56 2021 +0100 sf_dialog, sf_dialogcontrol as of 7.2 Change-Id: I970cf55070e21d4c69464cc0984fe1d1dfe894b2 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111044 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 65fc41da7..0b2633a92 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -69,6 +69,7 @@ $(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/avail_release \ helpcontent2/source/text/sbasic/shared/03/lib_tools \ helpcontent2/source/text/sbasic/shared/03/lib_euro \ helpcontent2/source/text/sbasic/shared/03/lib_depot \ diff --git a/source/text/sbasic/shared/03/avail_release.xhp b/source/text/sbasic/shared/03/avail_release.xhp new file mode 100644 index 0..a7666f637 --- /dev/null +++ b/source/text/sbasic/shared/03/avail_release.xhp @@ -0,0 +1,45 @@ + + + + + + +(Un)Available since release +/text/sbasic/shared/03/avail_release.xhp + + + + + This method is not available in Basic. + This property is not available in Basic. + This method is not available in Python. + This property is not available in Python. + + +These methods are available from %PRODUCTNAME 7.2 onwards. + + + +This control is available from %PRODUCTNAME 7.2 onwards. + + +These event properties are available from %PRODUCTNAME 7.2 onwards. + + +This property is available from %PRODUCTNAME 7.2 onwards. + + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03/sf_dialog.xhp b/source/text/sbasic/shared/03/sf_dialog.xhp index b96ef4752..6565192a6 100644 --- a/source/text/sbasic/shared/03/sf_dialog.xhp +++ b/source/text/sbasic/shared/03/sf_dialog.xhp @@ -56,7 +56,10 @@ End Sub Note that in previous examples, the prefix "SFDialogs." may be omitted. - Properties + + Properties or methods marked below as (7.2) are available as from %PRODUCTNAME 7.2 onwards. + + Properties @@ -74,13 +77,13 @@ -OKBUTTON +OKBUTTON -Yes +Yes -Integer +Integer Value = 1. An OK button was pressed. @@ -88,13 +91,13 @@ -CANCELBUTTON +CANCELBUTTON -Yes +Yes -Integer +Integer Value = 0. A Cancel button was pressed. @@ -102,13 +105,13 @@ -Caption +Caption No -String +String Specify the title of the dialog. @@ -116,13 +119,13 @@ -Height +Height No -Long +Long Specify the height of the dialog box. @@ -130,13 +133,13 @@ -Modal +Modal -Yes +Yes -Boolean +Boolean Specifies if the dialog box is currently in execution in modal mode. @@ -144,13 +147,13 @@ -Name +Name -Yes +Yes -String +String The name of the dialog @@ -158,13 +161,13 @@ -Page +Page -No +No -Integer +Integer A dialog may have several pages that can be traversed by the user step by step. The Page property of the Dialog object defines which page of the dialog is active. @@ -172,13 +175,13 @@ -Visible +Visible
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_database.xhp | 324 +++ 3 files changed, 326 insertions(+), 1 deletion(-) New commits: commit ae361f8f4f70c43d7082dd37c0a3f69bf49fa3e0 Author: Rafael Lima AuthorDate: Wed Mar 10 15:46:49 2021 +0100 Commit: Rafael Lima CommitDate: Fri Mar 12 00:25:12 2021 +0100 Create SF_Database Help page Change-Id: I4ab158e8089973af24155d3b9d0697734acdf4bb Reviewed-on: https://gerrit.libreoffice.org/c/help/+/112228 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 90b40453f..65fc41da7 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -79,6 +79,7 @@ $(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_database \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 30520ca95..c59831b92 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -120,7 +120,7 @@ - Database + diff --git a/source/text/sbasic/shared/03/sf_database.xhp b/source/text/sbasic/shared/03/sf_database.xhp new file mode 100644 index 0..6c137ef47 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_database.xhp @@ -0,0 +1,324 @@ + + + + + + +SFDatabases.Database service +/text/sbasic/shared/03/sf_database.xhp + + + + + + Database service + + + + +SFDatabases.Database service +The Database service provides access to databases either embedded or described in Base documents. This service provides methods to: + + +Get access to data in database tables. + + +Run SELECT queries and perform aggregate functions. + + +Run SQL action statements such as INSERT, UPDATE, DELETE, etc. + + + +TODO: Add reference to the future help page SFDocuments.SF_Form service in the paragraph below +Each instance of the Database service represents a single database and gives access to its tables, queries and data. This service does not provide access to forms or reports in the Base document. +All exchanges between this service and the database are done using SQL only. +SQL statements may be run in direct or indirect mode. In direct mode the statement is transferred to the database engine without any syntax checking or review. +The provided interfaces include simple tables and queries lists, as well as access to database data. +To make SQL statements more readable, you can use optional square brackets to enclose tables, queries and fields instead of using other enclosing characters that may be exclusive to certain Relational Database Management Systems (RDBMS). + +Service invocation + +The code snippet below shows how to access any database with the Database service. + +Dim myDatabase As Object +Set myDatabase = CreateScriptService("SFDatabases.Database", [FileName], [RegistrationName], [ReadOnly], [User, [Password]]) +' ... Run queries, SQL statements, ... +myDatabase.CloseDatabase() + + +FileName: The name of the Base file. Must be expressed using SF_FileSystem.FileNaming notation. +RegistrationName: The name of a registered database. If a file name is provided, this argument should not be used. +Conversely, if a RegistrationName is specified, the FileName parameter should not be defined. +ReadOnly: Determines if the database will be opened as readonly (Default = True). +User, Password: Additional connection parameters to the database server. + +Accessing Databases with the UI Service +It is also possible to access the database associated with a Base document using the ScriptForge.UI service, as shown in the example below: + +Dim myDoc As Object, myDatabase As Object, ui As Object +Set ui = CreateScriptService("UI") +Set myDoc = ui.OpenBaseDocument("myDb.odb") +' User and password are supplied below, if needed +Set myDatabase = myDoc.GetDatabase() +' ... Run queries, SQL statements, ... +myDoc.CloseDocument() + + + +Database Service;Queries +Database Service;Tables + +Properties + + + + Name +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_l10n.xhp |6 source/text/sbasic/shared/03/sf_platform.xhp | 253 +++ 4 files changed, 259 insertions(+), 3 deletions(-) New commits: commit 37af11b1043178f17a2abcd415348fb353f2fc3e Author: Rafael Lima AuthorDate: Fri Mar 5 01:22:31 2021 +0100 Commit: Jean-Pierre Ledure CommitDate: Tue Mar 9 15:44:47 2021 +0100 Create the Help page for Platform service Also in this patch: - sf_l10n.xhp: add new notes to explain L10N Change-Id: Id3ed5022a779f791e5a518154f9f7ffe3b84566e Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111928 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4148d45ff..90b40453f 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_exception \ helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ helpcontent2/source/text/sbasic/shared/03/sf_l10n \ +helpcontent2/source/text/sbasic/shared/03/sf_platform \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 10e43fda7..30520ca95 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -144,7 +144,7 @@ - Platform + diff --git a/source/text/sbasic/shared/03/sf_l10n.xhp b/source/text/sbasic/shared/03/sf_l10n.xhp index fd84b0f71..d6e52385e 100644 --- a/source/text/sbasic/shared/03/sf_l10n.xhp +++ b/source/text/sbasic/shared/03/sf_l10n.xhp @@ -36,10 +36,11 @@ -The L10N service is based on the GNU implementation of PO (portable object) files. To learn more about this file format, visit https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html"; name="GetText">GNU gettext Utilities: PO Files. +The acronym L10N stands for Localization and refers to a set of procedures for translating software to a specific country or region. PO files have long been promoted in the free software community as a means to providing multilingual user interfaces. This is accomplished through the use of human-readable text files with a well defined structure that specifies, for any given language, the source language string and the localized string. The main advantage of the PO format is dissociation of the programmer and the translator. PO files are independent text files, so the programmer can send POT template files to translators, who will then translate their contents and return the translated PO files for each supported language. -This service implements the three methods listed below: +The L10N service is based on the GNU implementation of PO (portable object) files. To learn more about this file format, visit https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html"; name="GetText">GNU gettext Utilities: PO Files. + This service implements the three methods listed below: AddText: Used by the programmer to build a set of strings that will be translated later. @@ -238,6 +239,7 @@ myPO.GetText(MsgId As String[, Arg1[, Arg2[, ...]]]) As String myPO._(MsgId As String[, Arg1[, Arg2[, ...]]]) As String +In the ScriptForge library, all methods starting with the "_" character are reserved for internal use only. However, the shortcut _ used for GetText is the only exception to this rule, hence it can be safely used in Basic scripts. MsgId: The untranslated string, which is the text appearing in the program code. It must not be empty. It may contain any number of placeholders (%1 %2 %3 ...) that can be used to dynamically insert text at runtime. Besides using a single MsgId string, this method also accepts the following formats: diff --git a/source/text/sbasic/shared/03/sf_platform.xhp b/source/text/sbasic/shared/03/sf_platform.xhp new file mode 100644 index 0..e719ea8b9 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_platform.xhp @@ -0,0 +1,253 @@ + + + + + + +ScriptForge.Platform service +/text/sbasic/shared/03/sf_platform.xhp + + + + + + +Platform service + + + + +ScriptForge.Platform service + + The Platform service provides a collection of properties about the current execution environment and context, such as: + + + The hardware platform (architecture, CPU count, machine type, etc) + + + Operating system information (OS type, release, ve
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_l10n.xhp | 268 +++ source/text/sbasic/shared/03/sf_string.xhp |4 source/text/sbasic/shared/03/sf_timer.xhp| 22 - 5 files changed, 285 insertions(+), 16 deletions(-) New commits: commit d87d59a9e8f8143d2faedfb47c4ddcb937535706 Author: Rafael Lima AuthorDate: Fri Feb 26 18:20:26 2021 +0100 Commit: Jean-Pierre Ledure CommitDate: Mon Mar 1 17:22:33 2021 +0100 Create SF_L10N Help page Also in this patch: - sf_timer: toggle translation of strings - sf_string: fix typo / add tag Change-Id: I45356a23104744e41b339d23ecaf03652bb0a765 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111591 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index cc0b7f383..4148d45ff 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -85,6 +85,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_document \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ +helpcontent2/source/text/sbasic/shared/03/sf_l10n \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 82e11d5c6..10e43fda7 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -99,7 +99,7 @@ - Localization + L10N Platform Services @@ -140,8 +140,8 @@ - - Localization (L10N) + + Platform diff --git a/source/text/sbasic/shared/03/sf_l10n.xhp b/source/text/sbasic/shared/03/sf_l10n.xhp new file mode 100644 index 0..ba931c0c6 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_l10n.xhp @@ -0,0 +1,268 @@ + + + + + + +ScriptForge.L10N service +/text/sbasic/shared/03/sf_l10n.xhp + + + + + + L10N service + + + + +ScriptForge.L10N service + +This service provides a number of methods related to the translation of strings with minimal impact on the program's source code. The methods provided by the L10N service can be used mainly to: + + +Create POT files tha can be used as templates for translation of all strings in the program. + + +Get translated strings at runtime for the language defined in the Locale property. + + + + +The L10N service is based on the GNU implementation of PO (portable object) files. To learn more about this file format, visit https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html"; name="GetText">GNU GetText Utilities: PO Files. +PO files have long been promoted in the free software community as a means to providing multilingual user interfaces. This is accomplished through the use of human-readable text files with a well defined structure that specifies, for any given language, the source language string and the localized string. +The main advantage of the PO format is dissociation of the programmer and the translator. PO files are independent text files, so the programmer can send POT template files to translators, who will then translate their contents and return the translated PO files for each supported language. +This service implements the 3 methods listed below: + + +AddText: Used by the programmer to build a set of strings that will be translated later. + + +ExportToPOTFile: Exports the strings added by the AddText method to a POT file. + + +GetText: Gets the translated strings at runtime. + + +Note that the first two methods are used to build a set of translatable strings and export them to a POT file. However, it is not mandatory to create POT files using these methods. Since they are text files, the programmer could have created them using any text editor. + +Service invocation +To invoke the L10N service, two optional arguments can be specified to determine the folder where PO files are located and the locale to be used, as described below. + + +CreateScriptService("L10N" [, FolderName As String [, Locale as String]]) + +FolderName: The folder containing the PO files. It must be expressed in the FileSystem.FileNaming notation. +Locale: A string in the form "la-CO" (language-COUNTRY) or in the form "la" (language) only. +Several instances of the L10N servic
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 126 +--- source/text/sbasic/shared/03/sf_calc.xhp |6 source/text/sbasic/shared/03/sf_filesystem.xhp | 88 +++--- source/text/sbasic/shared/03/sf_textstream.xhp | 337 +++ 5 files changed, 469 insertions(+), 89 deletions(-) New commits: commit c2fa9223ea62e33237a98bdcca5eaab2bbc5bb41 Author: Rafael Lima AuthorDate: Wed Feb 17 23:56:07 2021 +0100 Commit: Alain Romedenne CommitDate: Mon Feb 22 18:12:27 2021 +0100 Create SF TextStream Help page Other minor changes: - sf_filesystem: remove blank spaces before colons; x-ref with sf_textstream - sf_calc: fix extra ")" at end of line; silence two strings for translation - lib_ScriptForge: changes the layout of the table of contents; silence a string for translation; Change-Id: I669e70ccd8c6b9462b5bd203bfb671c23dd8bc4f Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111046 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 53af112a0..cc0b7f383 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -88,6 +88,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_session \ helpcontent2/source/text/sbasic/shared/03/sf_services \ 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_ui \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 7ef2387b3..82e11d5c6 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -22,7 +22,7 @@ - + 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: @@ -30,46 +30,88 @@ Services from external libraries can be registered with the RegisterScriptServices(...) method in order to extend the set of available services. The ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. - - -Services provided by the ScriptForge library - - - - - Array - Calc - Database - Dialog - DialogControl - - - - - Dictionary - Document - Exception - FileSystem - - - - - Localization (L10N) - Platform - Services - Session - - - - - String - TextStream - Timer - UI - - - - + + Services provided by the ScriptForge library + + + + Category + + + Services + + + + + + + + LibreOffice Basic + + + + Array + Dictionary + Exception + + + + + FileSystem + String + TextStream + + + + + + Document Content + + + + Calc + Database + Document + + + + + + + + + User Interface + + + + Dialog + DialogControl + UI + + + + + + + + + Utilities + + + + Localization + Platform + Services + + + + + Session + Timer + + + + @@ -114,7 +156,7 @@ - TextStream class Service + diff --git a/source/text/sbasic/shared/03/sf_calc.xhp b/source/text/sbasic/shared/03/sf_calc.xhp index 156ef6a8e..a2b782bfb 100644 --- a/source/text/sbasic/shared/03/sf_calc.xhp +++ b/source/text/sbasic/shared/03/sf_calc.xhp @@ -67,7 +67,7 @@ The use of the prefix "SFDocuments." while calling the service is optional. Definitions -Many methods require a "Sheet" or a "Range" as argument. Single cells are considered a special case of a Range). +Many methods require a "Sheet" or a "Range" as argument. Single cells are considered a special case of a Range. Both may be expressed either as a s
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 + source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 6a461bd0ac2ccb8b385f24d0698d29cad49084b7 Author: Alain Romedenne AuthorDate: Wed Feb 17 13:40:31 2021 +0100 Commit: Rafael Lima CommitDate: Wed Feb 17 13:52:08 2021 +0100 make file and Scriptforge link past patch #111036 Change-Id: Id827cf8e5fa35ad61d7130ea3247bd6395ab1401 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111037 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index ea88a9d6f..53af112a0 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_exception \ helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ helpcontent2/source/text/sbasic/shared/03/sf_session \ +helpcontent2/source/text/sbasic/shared/03/sf_services \ helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index c3cd4ff3f..7ef2387b3 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -105,7 +105,7 @@ Platform - Services + ___ 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/text
AllLangHelp_sbasic.mk |5 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 112 +- source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 30 source/text/sbasic/shared/03/sf_filesystem.xhp| 962 ++ 4 files changed, 1052 insertions(+), 57 deletions(-) New commits: commit 00cf8de0436b61d64c7c406de2106ee0c1949459 Author: Rafael Lima AuthorDate: Fri Feb 12 18:47:36 2021 +0100 Commit: Alain Romedenne CommitDate: Wed Feb 17 13:32:10 2021 +0100 Create SF Filesystem Help page Also in this patch: - lib_ScriptForge.xhp: add links to table of contents - sf_dialogcontrol.xhp: silence strings for translation Change-Id: I9b69be483d93957cdc793d95f56f33a48e3f1c85 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110788 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d87b5eb2b..ea88a9d6f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -82,12 +82,13 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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 \ helpcontent2/source/text/sbasic/shared/03/sf_document \ +helpcontent2/source/text/sbasic/shared/03/sf_exception \ +helpcontent2/source/text/sbasic/shared/03/sf_filesystem \ helpcontent2/source/text/sbasic/shared/03/sf_session \ helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ +helpcontent2/source/text/sbasic/shared/03/sf_ui \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index c8f191265..c3cd4ff3f 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -29,71 +29,103 @@ 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: +The ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. -%PRODUCTNAME Basic -Document content -User interface (UI) -Utilities +Services provided by the ScriptForge library -Array -Dictionary -Exception -FileSystem -String -TextStream + Array + Calc + Database + Dialog + DialogControl -Document -Calc -Database + Dictionary + Document + Exception + FileSystem -UI -Dialog -DialogControls + Localization (L10N) + Platform + Services + Session - -Localization (L10N) -Platform -Services -Session + String + TextStream + Timer + UI - - - - - - - -FileSystem Service -L10n class Service -Platform Service -Services class Service - - -TextStream class Service - - + + + + + + + + + Database + + + + + + + + + + + + + + + + + + + + + Localization (L10N) + + + Platform + + + Services + + + + + + + + + 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. - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03/sf_dialogcontrol.
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/python/python_2_basic.xhp |2 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_array.xhp|8 source/text/sbasic/shared/03/sf_session.xhp | 490 +++ source/text/sbasic/shared/03/sf_string.xhp |2 6 files changed, 500 insertions(+), 5 deletions(-) New commits: commit d5eb6397f3b58d19d442c85aa4243ace4914bb59 Author: Alain Romedenne AuthorDate: Wed Feb 10 15:01:28 2021 +0100 Commit: Rafael Lima CommitDate: Fri Feb 12 18:42:16 2021 +0100 sf_session new help page - extra bookmark & link in sf_array - typo in py2bas - typo in sf-string Change-Id: I508722de9b4cb1e55e203ba97b470b28f1ba03ae Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110678 Tested-by: Jenkins Reviewed-by: Alain Romedenne diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 3db5bbb4d..d87b5eb2b 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -85,6 +85,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_document \ +helpcontent2/source/text/sbasic/shared/03/sf_session \ helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ diff --git a/source/text/sbasic/python/python_2_basic.xhp b/source/text/sbasic/python/python_2_basic.xhp index b9978122c..5cd5308c0 100644 --- a/source/text/sbasic/python/python_2_basic.xhp +++ b/source/text/sbasic/python/python_2_basic.xhp @@ -27,7 +27,7 @@ Xray calls interrupting Python script execution to help inspect variables. - The %PRODUCTNAME Application Programming Interface (API) Scripting Framework supports inter-language script execution between Python and Basic, or other supported programming languages for that matter. Arguments can be passed back and fourth across calls, providing they represent primitives data types that both languages recognize, and assuming that the Scripting Framework converts them appropriately. + The %PRODUCTNAME Application Programming Interface (API) Scripting Framework supports inter-language script execution between Python and Basic, or other supported programming languages for that matter. Arguments can be passed back and fourth across calls, provided that they represent primitive data types that both languages recognize, and assuming that the Scripting Framework converts them appropriately. It is recommended to have knowledge of Python standard modules and %PRODUCTNAME API features prior to perform inter-language calls from Python to Basic, JavaScript or any other script engine. diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 21fefe9fd..c8f191265 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -85,7 +85,7 @@ L10n class Service Platform Service Services class Service -Session Service + TextStream class Service diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp index c4df6ba66..d4b65fb01 100644 --- a/source/text/sbasic/shared/03/sf_array.xhp +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -17,6 +17,10 @@ + + Array service + + ScriptForge.Array service Provides a collection of methods for manipulating and transforming arrays of one dimension (vectors) and arrays of two dimensions (matrices). This includes set operations, sorting, importing to and exporting from text files. Arrays with more than two dimensions cannot be used with the methods in this service, the only exception being the CountDims method that accepts Arrays with any number of dimensions. @@ -197,7 +201,7 @@ Array service;ConvertToDictionary ConvertToDictionary - Store the content of a 2-columns array into a ScriptForge Dictionary object. + Store the content of a 2-columns array into a ScriptForge.Dictionary object. The key will be extracted from the first column, the item from the second. @@ -904,7 +908,7 @@ - + diff --git a/source/text/sbasic/shared/03/sf_session.xhp b/source/text/sbasic/shared/03/sf_session.xhp new file mode 100644 index 0..8c9aae2f0 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_session.xhp @@ -0,0 +1,490 @@ + + + + + + +ScriptForge.Session service +/text/sbasic/shared/03/sf_session.xhp + + + + + + + Session service + + +ScriptForge.Sess
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/0003.xhp |2 source/text/sbasic/shared/03/lib_ScriptForge.xhp |6 source/text/sbasic/shared/03/sf_array.xhp|2 source/text/sbasic/shared/03/sf_document.xhp | 30 source/text/sbasic/shared/03/sf_string.xhp | 1366 +++ 6 files changed, 1387 insertions(+), 20 deletions(-) New commits: commit 6abb464fb6017594f62b9a240a886012ee25dce2 Author: Rafael Lima AuthorDate: Thu Feb 4 16:05:42 2021 +0100 Commit: Olivier Hallot CommitDate: Sun Feb 7 23:04:54 2021 +0100 Recreates SF_String Help page (ScriptForge) SF_Array: - Adds a tag SF_Document: - Fixes localization issues pointed out by translators on WebLate 0003.xhp: - Fixes the message explaining how to load libraries Change-Id: I9361f86e7907b95e0546197203e2d23c6211fd4d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110366 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2fad16c6d..3db5bbb4d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -85,6 +85,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_document \ +helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index c525575f0..ea06d3aab 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -186,7 +186,7 @@ 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: +This library must be loaded before execution. Execute the following statement before running any macro that uses this library: diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 98db6187d..21fefe9fd 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -26,7 +26,7 @@ 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, ...]) + 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. @@ -76,8 +76,8 @@ - + @@ -86,7 +86,7 @@ Platform Service Services class Service Session Service -String Service + TextStream class Service diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp index 45f976099..c4df6ba66 100644 --- a/source/text/sbasic/shared/03/sf_array.xhp +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -17,7 +17,7 @@ -ScriptForge.Array service + ScriptForge.Array service Provides a collection of methods for manipulating and transforming arrays of one dimension (vectors) and arrays of two dimensions (matrices). This includes set operations, sorting, importing to and exporting from text files. Arrays with more than two dimensions cannot be used with the methods in this service, the only exception being the CountDims method that accepts Arrays with any number of dimensions. diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp index 35370f889..2d3f9d984 100644 --- a/source/text/sbasic/shared/03/sf_document.xhp +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -111,10 +111,10 @@ No -Dictionary +Dictionary service -Returns a ScriptForge.Dictionary object. After update, can be passed again to the property for updating the document.Individual items of the dictionary may be either strings, numbers, (Basic) dates or https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1util_1_1Duration.html"; name="Duration API">com.sun.star.util.Duration items. +Returns a ScriptForge.Dictionary object instance. After update, can be passed agai
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_array.xhp|2 source/text/sbasic/shared/03/sf_document.xhp | 28 source/text/sbasic/shared/03/sf_string.xhp | 1368 --- 5 files changed, 16 insertions(+), 1385 deletions(-) New commits: commit 57222f5d4710b0a2fc43e4273ccad8c952dc6510 Author: Olivier Hallot AuthorDate: Thu Feb 4 15:48:01 2021 +0100 Commit: Olivier Hallot CommitDate: Thu Feb 4 15:54:14 2021 +0100 Revert "Create Help page for the SF_String service" This reverts commit a6f6fa2254ced7120ac0fb0075b4fd5195c334af. Reason for revert: was not yet ready Change-Id: Ibc95e08e2cb2a1f2220b503f3ab472518f98a047 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110365 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 3db5bbb4d..2fad16c6d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -85,7 +85,6 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_document \ -helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 4a1fdfedc..98db6187d 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -86,7 +86,7 @@ Platform Service Services class Service Session Service - +String Service TextStream class Service diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp index c4df6ba66..45f976099 100644 --- a/source/text/sbasic/shared/03/sf_array.xhp +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -17,7 +17,7 @@ - ScriptForge.Array service +ScriptForge.Array service Provides a collection of methods for manipulating and transforming arrays of one dimension (vectors) and arrays of two dimensions (matrices). This includes set operations, sorting, importing to and exporting from text files. Arrays with more than two dimensions cannot be used with the methods in this service, the only exception being the CountDims method that accepts Arrays with any number of dimensions. diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp index 066990c40..35370f889 100644 --- a/source/text/sbasic/shared/03/sf_document.xhp +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -111,7 +111,7 @@ No -SF_Dictionary +Dictionary Returns a ScriptForge.Dictionary object. After update, can be passed again to the property for updating the document.Individual items of the dictionary may be either strings, numbers, (Basic) dates or https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1util_1_1Duration.html"; name="Duration API">com.sun.star.util.Duration items. @@ -125,7 +125,7 @@ No -String +String Gives access to the Description property of the document (also known as "Comments") @@ -139,7 +139,7 @@ Yes -SF_Dictionary +Dictionary Returns a ScriptForge.Dictionary object containing all the entries. Document statistics are included. Note that they are specific to the type of document. As an example, a Calc document includes a "CellCount" entry. Other documents do not. @@ -153,7 +153,7 @@ Yes -String +String String value with the document type ("Base", "Calc", "Writer", etc) @@ -167,7 +167,7 @@ Yes -Boolean +Boolean Exactly one of these properties is True for a given document. @@ -181,10 +181,10 @@ No -String +String -Gives access to the Keywords property of the document. Represented as a comma-separated list of keywords +Gives access to the Keywords property of the document. Represented as a comma-separated list of keywords @@ -195,10 +195,10 @@ Yes -Boolean +Boolean -True if the document is actually in read-onl
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_array.xhp|2 source/text/sbasic/shared/03/sf_document.xhp | 28 source/text/sbasic/shared/03/sf_string.xhp | 1368 +++ 5 files changed, 1385 insertions(+), 16 deletions(-) New commits: commit a6f6fa2254ced7120ac0fb0075b4fd5195c334af Author: Rafael Lima AuthorDate: Thu Feb 4 01:15:38 2021 +0100 Commit: Olivier Hallot CommitDate: Thu Feb 4 15:31:36 2021 +0100 Create Help page for the SF_String service SF_Array: - Adds a tag SF_Document: - Fixes localization issues pointed out by translators on WebLate Change-Id: Ifa0a3c7665796ea2e5464dc3f2bd9508b3f7847c Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110360 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2fad16c6d..3db5bbb4d 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -85,6 +85,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ helpcontent2/source/text/sbasic/shared/03/sf_document \ +helpcontent2/source/text/sbasic/shared/03/sf_string \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 98db6187d..4a1fdfedc 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -86,7 +86,7 @@ Platform Service Services class Service Session Service -String Service + TextStream class Service diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp index 45f976099..c4df6ba66 100644 --- a/source/text/sbasic/shared/03/sf_array.xhp +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -17,7 +17,7 @@ -ScriptForge.Array service + ScriptForge.Array service Provides a collection of methods for manipulating and transforming arrays of one dimension (vectors) and arrays of two dimensions (matrices). This includes set operations, sorting, importing to and exporting from text files. Arrays with more than two dimensions cannot be used with the methods in this service, the only exception being the CountDims method that accepts Arrays with any number of dimensions. diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp index 35370f889..066990c40 100644 --- a/source/text/sbasic/shared/03/sf_document.xhp +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -111,7 +111,7 @@ No -Dictionary +SF_Dictionary Returns a ScriptForge.Dictionary object. After update, can be passed again to the property for updating the document.Individual items of the dictionary may be either strings, numbers, (Basic) dates or https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1util_1_1Duration.html"; name="Duration API">com.sun.star.util.Duration items. @@ -125,7 +125,7 @@ No -String +String Gives access to the Description property of the document (also known as "Comments") @@ -139,7 +139,7 @@ Yes -Dictionary +SF_Dictionary Returns a ScriptForge.Dictionary object containing all the entries. Document statistics are included. Note that they are specific to the type of document. As an example, a Calc document includes a "CellCount" entry. Other documents do not. @@ -153,7 +153,7 @@ Yes -String +String String value with the document type ("Base", "Calc", "Writer", etc) @@ -167,7 +167,7 @@ Yes -Boolean +Boolean Exactly one of these properties is True for a given document. @@ -181,10 +181,10 @@ No -String +String -Gives access to the Keywords property of the document. Represented as a comma-separated list of keywords +Gives access to the Keywords property of the document. Represented as a comma-separated list of keywords @@ -195,10 +195,10 @@ Yes -Boolean +Boolean -True if the document is actually in read-onl
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |1 source/text/sbasic/shared/03/sf_calc.xhp | 1083 +++ source/text/sbasic/shared/03/sf_document.xhp | 49 - source/text/sbasic/shared/03/sf_exception.xhp| 48 - source/text/sbasic/shared/03/sf_ui.xhp | 128 +- 6 files changed, 1197 insertions(+), 113 deletions(-) New commits: commit 3afce37d8a47b2b95a8228492b223b462b5e6502 Author: Rafael Lima AuthorDate: Tue Jan 26 00:59:42 2021 +0100 Commit: Olivier Hallot CommitDate: Fri Jan 29 13:02:23 2021 +0100 Create SF_Calc help page (ScriptForge) Also fixes localization issues in previously created pages adding/removing localize="false" tags. Change-Id: I71c8dad854be5cacfd4c701850fe539630689d45 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109882 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 83ff3bad2..57cfed0d9 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -78,6 +78,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_script \ 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_dictionary \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 2185a1364..2813a026d 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -34,6 +34,7 @@ ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. + diff --git a/source/text/sbasic/shared/03/sf_calc.xhp b/source/text/sbasic/shared/03/sf_calc.xhp new file mode 100644 index 0..f988184f8 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_calc.xhp @@ -0,0 +1,1083 @@ + + + + + + +SFDocuments.Calc service +/text/sbasic/shared/03/sf_calc.xhp + + + + + + + Calc service + + + + +SFDocuments.Calc service +The SFDocuments library provides a number of methods and properties to facilitate the management and handling of LibreOffice Calc documents. +Some methods are generic for all types of documents and are inherited from the SF_Document service, whereas other methods are specific for the SF_Calc module. +The SF_Calc module is focused on: + + +Handling sheets within a Calc document (copy, insert, move, etc) + + +Exchanging data between Basic data structures and Calc ranges + + +Copying and importing massive amounts of data + + + + + Service invocation + Before using the Calc service the ScriptForge library needs to be loaded using: + +GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") + + The Calc service is closely related to the UI service of the ScriptForge library. Below are a few examples of how the Calc service can be invoked. + +'1) From the ScriptForge.UI service: +Dim ui As Object, oDoc As Object +Set ui = CreateScriptService("UI") +Set oDoc = ui.CreateDocument("Calc") +'Or: Set oDoc = ui.OpenDocument("C:\Me\MyFile.ods") + + +'2) Directly if the document is already open +Dim oDoc As Object +Set oDoc = CreateScriptService("SFDocuments.Calc", "Untitled 1") 'Default = ActiveWindow + + It is recommended to free resources after use: + +Set oDoc = oDoc.Dispose() + + However, if the document was closed using the CloseDocument method, it becomes unnecessary to free resources using the command described above. + The use of the prefix "SFDocuments." while calling the service is optional. + + Definitions +Many methods require a "Sheet" or a "Range" as argument. Single cells are considered a special case of a Range). +Both may be expressed either as a string or as a reference (= object) depending on the situation: + + +Within a specific Calc instance, sheets and ranges are given as strings such as "Sheet1" and "D2:F6". + + +Additionally, the .Sheet and .Range properties return a reference that may be used as argument of a method called from another instance of the Calc service. + + + +The example below copies data from document A (opened as read-only and hidden) to document B. + +Dim oDocA As Object, oDocB As Object +Set oDocA = ui.OpenDocument("C:\FileA.ods", Hidden := True, ReadOnly := True) +Set oDocB = ui.OpenDocument("C:\FileB.ods") +oDocB.CopyToRange(oDocA.Range("SheetX.D4
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |3 source/text/sbasic/shared/03/sf_dictionary.xhp |2 source/text/sbasic/shared/03/sf_document.xhp | 458 +++ source/text/sbasic/shared/03/sf_ui.xhp |2 5 files changed, 463 insertions(+), 3 deletions(-) New commits: commit 37a79c487851addcdac66d5f229556a53f5d4416 Author: Rafael Lima AuthorDate: Wed Jan 20 17:56:55 2021 +0100 Commit: Olivier Hallot CommitDate: Sat Jan 23 14:36:12 2021 +0100 Create SFDocuments Help page (ScriptForge) Adds a new Help page for the Document service provided by ScriptForge. Add a tag to the sf_ui.xhp for x-ref. Change-Id: Ic65daf9ebcecddf569bd494c10010f03bb360299 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109687 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d52490190..83ff3bad2 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -81,6 +81,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ +helpcontent2/source/text/sbasic/shared/03/sf_document \ helpcontent2/source/text/sbasic/shared/03/sf_timer \ helpcontent2/source/text/sbasic/shared/03/lib_schedule \ helpcontent2/source/text/sbasic/shared/03/lib_template \ diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index d8085f7a8..2185a1364 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -27,7 +27,7 @@ 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, ...]) + [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. @@ -35,6 +35,7 @@ + FileSystem Service L10n class Service diff --git a/source/text/sbasic/shared/03/sf_dictionary.xhp b/source/text/sbasic/shared/03/sf_dictionary.xhp index be4602d2b..198afb46f 100644 --- a/source/text/sbasic/shared/03/sf_dictionary.xhp +++ b/source/text/sbasic/shared/03/sf_dictionary.xhp @@ -21,7 +21,7 @@ Dictionary service - ScriptForge.Dictionary service + ScriptForge.Dictionary service A dictionary is a collection of key-item pairs diff --git a/source/text/sbasic/shared/03/sf_document.xhp b/source/text/sbasic/shared/03/sf_document.xhp new file mode 100644 index 0..656887907 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_document.xhp @@ -0,0 +1,458 @@ + + + + + + +SFDocuments.Document service +/text/sbasic/shared/03/sf_document.xhp + + + + + + + Document service + + + + +SFDocuments.Document service + The SFDocuments library provides methods and properties to facilitate the management and manipulation of LibreOffice documents. + Methods that are applicable for all types of documents (Text Documents, Sheets, Presentations, etc) are provided by the SFDocuments.Document service. Some examples are: + + +Opening, closing and saving documents + + +Accessing standard or custom properties of documents + + + + + The properties, methods or arguments marked with (*) are NOT applicable to Base documents. + + Methods and properties that are specific to certain LibreOffice components are stored in separate services, such as SFDocuments.SF_Calc and SFDocuments.SF_Base. + Although the Basic language does not offer inheritance between object classes, the latter services may be considered as subclasses of the SFDocuments.Document service. Such subclasses can invoke the properties and methods described below. + + Service invocation + Before using the Document service the ScriptForge library needs to be loaded using: + +GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") + + + The Document service is closely related to the UI and FileSystem services of the ScriptForge library. + Below are three variants of how the Document service can be invoked. + + +'1) From the ScriptForge.UI service: +Dim ui As Object, oDoc As Object +Set ui = CreateScriptService("UI") +Set oDoc = ui.GetDocument("Untitled 1") +' or Set oDoc = ui.CreateDocument("Calc", ...) +' or Set oDoc = ui.OpenDocument("C:\MyFile.odt") + + + +'2) Directly if the document is already open +Dim oDoc As Object +Set oDoc = CreateScriptSe
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_timer.xhp| 275 +++ source/text/sbasic/shared/03030203.xhp |8 source/text/sbasic/shared/03030303.xhp |8 source/text/sbasic/shared/03130700.xhp |6 6 files changed, 296 insertions(+), 4 deletions(-) New commits: commit 2bf658142b7e3c859d353e0d964aa1404fb0087e Author: Rafael Lima AuthorDate: Fri Jan 15 21:30:35 2021 +0100 Commit: Olivier Hallot CommitDate: Tue Jan 19 14:04:38 2021 +0100 Creates Help page for ScriptForge Timer service Change-Id: Id3d0832056edcbd828dd9eadaca4ed906088dc73 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109394 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index ccd40d2f6..d52490190 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -81,6 +81,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ helpcontent2/source/text/sbasic/shared/03/sf_ui \ +helpcontent2/source/text/sbasic/shared/03/sf_timer \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index b22d86e9f..d8085f7a8 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -43,7 +43,7 @@ Session Service String Service TextStream class Service -Timer class Service + Restricted use for SF_Root, SF_Utils modules as well as internal methods diff --git a/source/text/sbasic/shared/03/sf_timer.xhp b/source/text/sbasic/shared/03/sf_timer.xhp new file mode 100644 index 0..56ac6515a --- /dev/null +++ b/source/text/sbasic/shared/03/sf_timer.xhp @@ -0,0 +1,275 @@ + + + + + + +ScriptForge.Timer service +/text/sbasic/shared/03/sf_timer.xhp + + + + + + + Timer service + + + + + ScriptForge.Timer service + The Timer service measures the amount of time it takes to run user scripts. + A Timer measures durations. It can be: + + + Started, to indicate when to start measuring time. + + + Suspended, to pause measuring running time. + + + Resumed, to continue tracking running time after the Timer has been suspended. + + + Restarted, which will cancel previous measurements and start the Timer at zero. + + + + Durations are expressed in seconds with a precision of 3 decimal digits (milliseconds). A duration value of 12.345 means 12 seconds and 345 milliseconds + + Service invocation + Before using the Timer service the ScriptForge library needs to be loaded using: + +GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") + + The example below creates a Timer object named myTimer and starts it immediately. + +Dim myTimer As Variant +myTimer = CreateScriptService("Timer", True) +'The timer starts immediately when the second argument = True, default = False + + It is recommended to free resources after use: + +Set myTimer = myTimer.Dispose() + + Properties + + + +Name + + +Readonly + + +Type + + +Description + + + + +Duration + + +Yes + + +Double + + +The actual running time elapsed since start or between start and stop (does not consider suspended time) + + + + +IsStarted + + +Yes + + +Boolean + + +True when timer is started or suspended + + + + +IsSuspended + + +Yes + + +Boolean + + +True when timer is started and suspended + + + + +SuspendDuration + + +Yes + + +Double + + +The actual time elapsed while suspended since start or between start and stop + + + + +TotalDuration + + +Yes + + +Double + + +The actual time elapsed since start or between start and stop (including suspensions and running time) + + + +Note that the TotalDuration property is equivalent to summing
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp |2 source/text/sbasic/shared/03/sf_ui.xhp | 436 +++ 3 files changed, 438 insertions(+), 1 deletion(-) New commits: commit 10f14ef2d4c0eec654ae02c00388fac7127cc980 Author: Alain Romedenne AuthorDate: Thu Jan 14 13:43:13 2021 +0100 Commit: Olivier Hallot CommitDate: Sat Jan 16 00:08:19 2021 +0100 ScriptForge Basic library - WiP - UI module help page Change-Id: Icb011f54c0cdd3d870f0ad6c4bc92aa98f8c2c17 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109281 Tested-by: Jenkins Reviewed-by: Rafael Lima Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2e7ba6f02..ccd40d2f6 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -80,6 +80,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/sf_array \ helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ helpcontent2/source/text/sbasic/shared/03/sf_exception \ +helpcontent2/source/text/sbasic/shared/03/sf_ui \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 619650142..b22d86e9f 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -44,7 +44,7 @@ String Service TextStream class Service Timer class Service -UI 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. diff --git a/source/text/sbasic/shared/03/sf_ui.xhp b/source/text/sbasic/shared/03/sf_ui.xhp new file mode 100644 index 0..06d2a0f3e --- /dev/null +++ b/source/text/sbasic/shared/03/sf_ui.xhp @@ -0,0 +1,436 @@ + + + + + + +ScriptForge.UI service +/text/sbasic/shared/03/sf_ui.xhp + + + + + + UI service + + +ScriptForge.UI service + +The UI (User Interface) service simplifies the identification and the manipulation of the different windows composing the whole LibreOffice application: + + + Windows selection + + + Windows moving and resizing + + + Statusbar settings + + + Display of a floating progress bar + + + Creation of new windows + + + Access to the underlying "documents" + + + + +The UI service is the starting point to open, create or access to the content of new or existing documents from a user script. + + +Definitions + + WindowName + A window can be designated using various ways: + + +a full path and file name + + +the last component of the full file name or even only the last component without its suffix + + +the title of the window + + +for new documents, something like "Untitled 1" + + +one of the special windows "BASICIDE" and "WELCOMESCREEN" + + + The window name is case-sensitive. + Document object + The methods CreateDocument, CreateBaseDocument, GetDocument and OpenDocument, described below, generate document objects. When a window contains a document, an instance of the Document class represents that document. A counterexample the Basic IDE is not a document but is a window in our terminology. Additionally a document has a type: Calc, Impress, Writer, ... + The specific properties and methods applicable on documents are implemented in a document class. + The implementation of the document objects class is done in the SFDocuments associated library. See its "Document" service. + +Service invocation + + Dim ui As Variant + GlobalScope.BasicLibraries.loadLibrary("ScriptForge") + Set ui = CreateScriptService("UI") + + +Properties + + + + Name + + + ReadOnly + + + Type + + + Description + + + + + ActiveWindow + + + Yes + + + String + + + a valid and unique WindowName for the currently active window. When the window cannot be identified, a zero-length string is returned. + + + + + Documents + + + Yes + + + String array + + + The list of the currently open documents. Special windows are ignored. This list consists of a zero-based one dimensional array either of filenames (in SF_FileSy
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 28 - source/text/sbasic/shared/03/sf_exception.xhp| 332 +++ source/text/sbasic/shared/ErrVBA.xhp |5 4 files changed, 350 insertions(+), 16 deletions(-) New commits: commit 40c4109b5b8554f5c068b0ccadad5577a6a0096c Author: Alain Romedenne AuthorDate: Wed Dec 16 15:05:25 2020 +0100 Commit: Olivier Hallot CommitDate: Wed Jan 6 12:49:44 2021 +0100 ScriptForge library modules - WiP - Exception module - 7.1 mention in lib_Scriptforge - x-refs between VBA Err object and sf_exception Change-Id: I8512635ff54b50bb190c3fe734441d6b7e9ae9c1 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/107798 Tested-by: Jenkins Tested-by: Olivier Hallot Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 71d311cdf..2e7ba6f02 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -79,6 +79,7 @@ $(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_dictionary \ +helpcontent2/source/text/sbasic/shared/03/sf_exception \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index ef5f49d24..1e808ecb9 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -31,26 +31,24 @@ Services from external libraries can be registered with the RegisterScriptServices(...) method in order to extend the set of available services. - - -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. - +ScriptForge Basic library is available from %PRODUCTNAME 7.1 onwards. -Exception class Service + FileSystem Service -L10n class Service -Platform Service -Services class Service -Session Service -String Service -TextStream class Service -Timer class Service -UI Service +L10n class Service +Platform Service +Services class Service +Session Service +String Service +TextStream class Service +Timer class Service +UI Service -Restricted use for SF_Root, SF_Utils -Other ScriptForge undescribed modules are restricted to this library internal use. Their content is subject to change without notice. +Restricted use for SF_Root, SF_Utilsa modules as weel 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. diff --git a/source/text/sbasic/shared/03/sf_exception.xhp b/source/text/sbasic/shared/03/sf_exception.xhp new file mode 100644 index 0..585fcf8b2 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_exception.xhp @@ -0,0 +1,332 @@ + + + + + + + ScriptForge.Exception service (SF_Exception) + /text/sbasic/shared/03/sf_exception.xhp + + + + + + Exception service + + ScriptForge.Exception service + The Exception service is a collection of methods for Basic code debugging and error handling. + In the advent of a run-time error, the Exception service properties and methods help identify the error context and permit to handle it. + + + The SF_Exception service is similar to the VBA Err object. + The Number property identifies the error. + Use Raise() method to interrupt processing, use RaiseWarning() method to trap an anomaly and continue processing. + + Errors or warnings raised with the Exception service are stored in memory and can be retrieved using its Console() method. + + The Exception service console stores events, variable values and information about errors. Use the console when Basic IDE is not accessible, for example in Calc user defined functions (UDF) or during events processing. Use DebugPrint() method to aggregate additional user data. Console entries can be dumped to a text file or visualized in a dialogue. + When an error occurs, an application macro may: + + Report the error in the Exception console + Inform the user about the error using either a standard message either a customized message + Optionally stop its execution
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|2 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 21 - source/text/sbasic/shared/03/sf_array.xhp| 410 +++ source/text/sbasic/shared/03/sf_dictionary.xhp | 410 +++ 4 files changed, 835 insertions(+), 8 deletions(-) New commits: commit 24db50ae5193babbd5db33c0344ca0c5e3e1 Author: Alain Romedenne AuthorDate: Tue Nov 24 16:33:22 2020 +0100 Commit: Olivier Hallot CommitDate: Tue Dec 8 00:30:40 2020 +0100 ScriptForge library modules - WiP + Array module + Dictionary module Change-Id: Ida2290005befb59f2b7c3699744ff49b32226e24 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/106513 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 7423e9eba..71d311cdf 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -77,6 +77,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03/lib_importwiz \ helpcontent2/source/text/sbasic/shared/03/lib_script \ helpcontent2/source/text/sbasic/shared/03/lib_ScriptForge \ +helpcontent2/source/text/sbasic/shared/03/sf_array \ +helpcontent2/source/text/sbasic/shared/03/sf_dictionary \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index c0f33a9c9..ef5f49d24 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -24,28 +24,33 @@ 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 registered with the RegisterScriptServices(...) method in order to extend the set of available services. -Array Service -Dictionary class Service +Services from external libraries can be registered with the RegisterScriptServices(...) method in order to extend the set of available services. + + +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. + + + + Exception class Service FileSystem Service L10n class Service Platform Service -Root class Service Services class Service Session Service String Service -TestStream class Service +TextStream class Service Timer class Service UI Service -Utils Service + +Restricted use for SF_Root, SF_Utils +Other ScriptForge undescribed modules are restricted to this library internal use. Their content is subject to change without notice. diff --git a/source/text/sbasic/shared/03/sf_array.xhp b/source/text/sbasic/shared/03/sf_array.xhp new file mode 100644 index 0..d37af6f49 --- /dev/null +++ b/source/text/sbasic/shared/03/sf_array.xhp @@ -0,0 +1,410 @@ + + + + + + +ScriptForge.Dictionary service +/text/sbasic/shared/03/sf_dictionary.xhp + + + + + + Dictionary service + API;DateTime + API;PropertyValue + + + ScriptForge.Dictionary service + + A dictionary is a collection of key-item pairs + +The key is a case-insensitive string +Items may be of any type + + + + 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. + + Service invocation + + +GlobalScope.BasicLibraries.loadLibrary("ScriptForge") +Dim myDict As Variant + myDict = CreateScriptService("Dictionary") + + + It is recommended to free resources after use: + + Set myDict = myDict.Dispose() + + + + + Properties + + + + +Name + + +Readonly + + +Argument + + +Type + + +Description + + + + +Count + + +Yes + + + + + +Long + + +The actual number of entries in the dictionary + + + + +Item + + +Yes + + +Key As Str
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/shared/03/lib_ScriptForge.xhp | 51 +++ 2 files changed, 52 insertions(+) New commits: commit e4bc24515c948609dd96488ec087b10f91ca5cd0 Author: Alain Romedenne AuthorDate: Mon Nov 23 17:34:20 2020 +0100 Commit: Olivier Hallot CommitDate: Mon Nov 23 22:50:50 2020 +0100 ScriptForge library help - WiP main page Change-Id: I27f9fc5d1731fd23a0130c52f372711a920a02d7 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/106433 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index aa40d7b18..7423e9eba 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -76,6 +76,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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_ScriptForge \ 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/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp new file mode 100644 index 0..c0f33a9c9 --- /dev/null +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -0,0 +1,51 @@ + + + + + +ScriptForge Library +/text/sbasic/shared/03/lib_ScriptForge.xhp + + + +The ScriptForge Library + +BASIC ScriptForge library + + + + + +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 registered with the RegisterScriptServices(...) method in order to extend the set of available services. + +Array Service +Dictionary class Service +Exception class Service +FileSystem Service +L10n class Service +Platform Service +Root class Service +Services class Service +Session Service +String Service +TestStream class Service +Timer class Service +UI Service +Utils Service + + + ___ 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/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/03090404.xhp |3 source/text/sbasic/shared/03090412.xhp |8 +- source/text/sbasic/shared/property.xhp | 102 + 4 files changed, 110 insertions(+), 4 deletions(-) New commits: commit ad3253b3663b04e06e21cba1f9aac82c9e088d3d Author: LibreOfficiant AuthorDate: Wed Feb 5 17:50:18 2020 +0100 Commit: Olivier Hallot CommitDate: Sat Feb 22 13:13:19 2020 +0100 Basic Property statement new help Change-Id: I4386954ea6f6a22fa1f6d8df5695c574cacba19e Reviewed-on: https://gerrit.libreoffice.org/c/help/+/88051 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 0b31b3e7a..714338107 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -363,6 +363,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/partition \ +helpcontent2/source/text/sbasic/shared/property \ helpcontent2/source/text/sbasic/shared/replace \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ diff --git a/source/text/sbasic/shared/03090404.xhp b/source/text/sbasic/shared/03090404.xhp index 0c933d7cb..ada8a37a8 100644 --- a/source/text/sbasic/shared/03090404.xhp +++ b/source/text/sbasic/shared/03090404.xhp @@ -40,7 +40,7 @@ Syntax: -End, End Enum, End Function, End If, End Select, End Sub, End With +End, End Enum, End Function, End If, End Property, End Select, End Sub, End With Parameters: @@ -51,6 +51,7 @@ End Enum: Ends an Enum VBA statement End Function: Ends a Function statement. End If: Marks the end of a If...Then...Else block. +End Property: Marks the end of a Property statement. End Select: Marks the end of a Select Case block. End Sub: Ends a Sub statement. End With: Ends a With statement diff --git a/source/text/sbasic/shared/03090412.xhp b/source/text/sbasic/shared/03090412.xhp index 81d2c871c..86523ddc9 100644 --- a/source/text/sbasic/shared/03090412.xhp +++ b/source/text/sbasic/shared/03090412.xhp @@ -32,15 +32,15 @@ Exit statement - + Exit Statement -Exits a Do...Loop, For...Next, a function, or a subroutine. +Exits a Do...Loop, For...Next, a function, a property, or a subroutine. Syntax: -see Parameters +Exit Do, Exit For, Exit Function, Exit Property, Exit Sub Parameters: @@ -50,6 +50,8 @@ Only valid within a For...Next loop to exit the loop. Program execution continues with the first statement that follows the Next statement. In nested statements, the control is transferred to the loop in the next higher level. Exit Function Exits the Function procedure immediately. Program execution continues with the statement that follows the Function call. + Exit Property +Exits the Property procedure immediately. Program execution continues with the statement that follows the Property call. Exit Sub Exits the subroutine immediately. Program execution continues with the statement that follows the Sub call. The Exit statement does not define the end of a structure, and must not be confused with the End statement. diff --git a/source/text/sbasic/shared/property.xhp b/source/text/sbasic/shared/property.xhp new file mode 100644 index 0..1a4cfd3d1 --- /dev/null +++ b/source/text/sbasic/shared/property.xhp @@ -0,0 +1,102 @@ + + + + + + Property Statement + /text/sbasic/shared/Property.xhp + + + + + Property statement + + Property Statement + A property, also called field or attribute, characterizes a given object or piece of information. Properties can be used to control access to data. It is common use to include instructions at setting or reading time of properties. Code can vary from simple assignment to complex context dependant routines. Using Get, Let or Set accessers enforces properties' consistency when necessary. + This statement requires Option Compatible to be placed before the executable program code in a module. + Syntax + + [Global | Private | Public] Property [Get | Let | Set] propName[(value As VarType)] [As VarType] + End Property + + Examples + + Option Compatible + Sub Main + ProductName = "Office" + Print ProductName ' displays "LibreOffice" + End Sub + + Private _office As String + Property Get ProductName As String + ProductName = _office + End Property + Property Let ProductName(value As String) + _office = "Libre"& value + End Property + + In the absence of Property Let or Property Set, Property Get helps define protected information, which can not be acciden
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/guide/basic_2_python.xhp | 180 ++ source/text/sbasic/guide/basic_examples.xhp |4 source/text/sbasic/python/python_2_basic.xhp |7 - source/text/sbasic/python/python_examples.xhp |4 5 files changed, 186 insertions(+), 10 deletions(-) New commits: commit 32ed2dcd315db480d0d85ff0853d19fd4d5916a4 Author: LibreOfficiant AuthorDate: Wed Oct 23 18:16:38 2019 +0200 Commit: Olivier Hallot CommitDate: Thu Oct 24 17:23:33 2019 +0200 Documenting how to call Python routines from Basic macros Change-Id: I904cafe91ad7c5e72d09209c68db401003dda556 Reviewed-on: https://gerrit.libreoffice.org/81412 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure Tested-by: Jean-Pierre Ledure Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index cc5f02cbc..0b31b3e7a 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -17,6 +17,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/basic_2_python \ helpcontent2/source/text/sbasic/guide/basic_examples \ helpcontent2/source/text/sbasic/guide/control_properties \ helpcontent2/source/text/sbasic/guide/create_dialog \ diff --git a/source/text/sbasic/guide/basic_2_python.xhp b/source/text/sbasic/guide/basic_2_python.xhp new file mode 100644 index 0..f80cb1658 --- /dev/null +++ b/source/text/sbasic/guide/basic_2_python.xhp @@ -0,0 +1,180 @@ + + + + + + Basic to Python + /text/sbasic/guide/basic_2_python.xhp + + + + + Basic;Calling Python + API;SimpleFileAccess + API;PathSettings + + Calling Python macros from Basic + Calling Python scripts from %PRODUCTNAME Basic macros is possible, and valuable features can be obtained such as: + + ComputerName identification or OSName detection are possible, + Basic FileLen() function and https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1ucb_1_1SimpleFileAccess.html"; name="ucb.SimpleFileAccess">com.sun.star.ucb.SimpleFileAccess.getSize() API function exhibit a 2 Gigabytes file size upper limit that Python helps to overcome, + https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1util_1_1PathSettings.html"; name="util.PathSettings">com.sun.star.util.PathSettings can be normalized, + and many more. + + A reasonable exposure to %PRODUCTNAME Basic and to https://api.libreoffice.org/"; name="Application Programming Interface">Application Programming Interface (API) features is recommended prior to perform inter-language calls from Basic to Python, to JavaScript or any other script engine. + Retrieving Python Scripts + Python scripts can be personal, shared, or embedded in documents. In order to execute them, %PRODUCTNAME Basic needs to be provided with Python script locations. Locating https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html"; name="script.provider.XScript">com.sun.star.script.provider.XScript interface compliant UNO objects allows the execution of Python scripts: + + Option Explicit + + Public Function GetPythonScript(macro As String, _ + Optional location As String) As com.sun.star.script.provider.Xscript + ''' Grab Python script object before execution + ' Arguments: + 'macro : as "library/module.py$macro" or "module.py$macro" + 'location: as "document", "share", "user" or ENUM(eration) + ' Result: + 'located com.sun.star.script.provider.XScript UNO service''' + If IsMissing(location) Then location = "user" + Dim mspf As Object ' com.sun.star.script.provider.MasterScriptProviderFactory + Dim sp As Object ' com.sun.star.script.provider.XScriptProvider compatible + Dim uri As String + If location="document" Then + sp = ThisComponent.getScriptProvider() + Else + mspf = CreateUNOService("com.sun.star.script.provider.MasterScriptProviderFactory") + sp = mspf.createScriptProvider("") + End If + uri = "vnd.sun.star.script:"& macro &"?language=Python&location="& location + GetPythonScript = sp.getScript(uri) + End Function ' GetPythonScript + + Executing Python Scripts + + Syntax + workstation_name = script.invoke(Array(), Array(), Array()) + opSysName = script.invoke(Array(), in_outs, Array()) ' in_out is an Array + file_len = script.invoke(Array(sy
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/compatibilitymode.xhp | 77 source/text/sbasic/shared/compatible.xhp| 45 ++ 3 files changed, 98 insertions(+), 25 deletions(-) New commits: commit ea0f53e1c29a43422531d62d04b4e939b5577ac7 Author: Olivier Hallot AuthorDate: Thu Jun 27 13:04:40 2019 -0300 Commit: Olivier Hallot CommitDate: Fri Jun 28 14:21:59 2019 +0200 Split VBA Compatibility files and enhance Add examples, Add cross-links Split files Change-Id: I92bef363f008aeed367167b50c4ea9a9943a62ff Reviewed-on: https://gerrit.libreoffice.org/74812 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 2d354fefa..a1f3fed2c 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/code-stubs \ helpcontent2/source/text/sbasic/shared/classmodule \ helpcontent2/source/text/sbasic/shared/compatible \ +helpcontent2/source/text/sbasic/shared/compatibilitymode \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/partition \ helpcontent2/source/text/sbasic/shared/replace \ diff --git a/source/text/sbasic/shared/compatibilitymode.xhp b/source/text/sbasic/shared/compatibilitymode.xhp new file mode 100644 index 0..68b6b444a --- /dev/null +++ b/source/text/sbasic/shared/compatibilitymode.xhp @@ -0,0 +1,77 @@ + + + + + +CompatibleMode function +/text/sbasic/shared/compatibilitymode.xhp + + + + +CompatibilityMode +VBA compatibility mode + + +CompatibilityMode() Function +CompatibilityMode() function is controlling runtime mode and affects all code executed after setting or resetting the mode. + +Use this feature with caution, limit it to document conversion situations for example. +Option Compatible turns on VBA compatibility at module level for the %PRODUCTNAME Basic compiler. +This function may affect or help in the following situations: + +Creating enumerations with Enum statement +Updating Dir execution conditions. +Running RmDir command in VBA mode. In VBA only empty directories are removed by RmDir while %PRODUCTNAME Basic removes a directory recursively. +Changing behaviour of Basic Dir command. The directory flag (16) for the Dir command means that only directories are returned in %PRODUCTNAME Basic, while in VBA normal files and directories are returned. + +CompatibilityMode() function may be necessary when resorting to Option Compatible or Option VBASupport compiler modes. + +CompatibilityMode(True | False) + +Given a NOT empty directory at file:///home/me/Test + +Sub RemoveDir +CompatibilityMode( true ) +RmDir( "file:///home/me/Test" ) +End Sub + + With CompatibilityMode( true ) the program results in an error, otherwise the Test directory and all its content is deleted. + + Modifying Dir behavior + +Sub VBADirCommand + CompatibilityMode( true ) ' Shows also normal files +Entry$ = Dir( "file:///home/me/Tmp/*.*", 16 ) +Total$ = "" +While Entry$ <> "" +Total$ = Total$ + Entry$ + Chr$(13) +Entry$ = Dir +Wend +MsgBox Total$ +End Sub + + + + + +Refer to Identifying the Operating System and Getting Session Information for Option Compatible simple examples, or Access2Base shared Basic library for other class examples making use of Option Compatible compiler mode. + + + +Variables scope modification in Using Procedures and Functions with CompatibilityMode() function. + + + + + + + + diff --git a/source/text/sbasic/shared/compatible.xhp b/source/text/sbasic/shared/compatible.xhp index a2655de54..4a48a388c 100644 --- a/source/text/sbasic/shared/compatible.xhp +++ b/source/text/sbasic/shared/compatible.xhp @@ -17,19 +17,21 @@ Option Compatible -CompatibilityMode -VBA compatibility +VBA compatibility option Option Compatible Statement -Option Compatible turns on the VBA-compatible Basic compiler mode at the module level. The function CompatibilityMode() controls runtime mode and affects all code executed after setting or resetting the mode. +Option Compatible turns on the VBA-compatible Basic compiler mode at the module level. +The function CompatibilityMode() controls runtime mode and affects all code executed after setting or resetting the mode. This option may affect
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/guide/basic_examples.xhp | 30 source/text/sbasic/shared/main0601.xhp |3 +- 3 files changed, 33 insertions(+), 1 deletion(-) New commits: commit 8b1f5909975addc35b77f7009c2ee65b2e4a365d Author: Olivier Hallot AuthorDate: Wed May 29 11:49:22 2019 -0300 Commit: Olivier Hallot CommitDate: Thu May 30 13:21:00 2019 +0200 WIP: refactor some Python/Basic pages Change-Id: I3590e7a6e0cf62d9f9e33e8081be50ab4d0ae769 Reviewed-on: https://gerrit.libreoffice.org/73175 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 90736b80f..2d354fefa 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -17,6 +17,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/basic_examples \ 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/text/sbasic/guide/basic_examples.xhp b/source/text/sbasic/guide/basic_examples.xhp new file mode 100644 index 0..7b398d102 --- /dev/null +++ b/source/text/sbasic/guide/basic_examples.xhp @@ -0,0 +1,30 @@ + + + + + + +Basic Programming Examples +/text/sbasic/guide/basic_examples.xhp + + + + +Basic;programming examples + + +Basic Programming Examples + + + + + + + diff --git a/source/text/sbasic/shared/main0601.xhp b/source/text/sbasic/shared/main0601.xhp index f4132765a..a93bdd268 100644 --- a/source/text/sbasic/shared/main0601.xhp +++ b/source/text/sbasic/shared/main0601.xhp @@ -29,7 +29,7 @@ -%PRODUCTNAME Basic Help +%PRODUCTNAME Basic Help %PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit https://api.libreoffice.org/"; name="api.libreoffice.org">https://api.libreoffice.org @@ -45,6 +45,7 @@ + Working with VBA Macros ___ 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/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/python/python_document_events.xhp | 279 +++ source/text/sbasic/python/python_examples.xhp|5 source/text/sbasic/python/python_listener.xhp| 12 source/text/sbasic/python/python_screen.xhp | 10 source/text/sbasic/python/python_session.xhp |1 6 files changed, 299 insertions(+), 9 deletions(-) New commits: commit 3f98a5fd443d3ff5789e4afa551389d3e2db64c3 Author: LibreOfficiant AuthorDate: Wed Apr 17 18:19:51 2019 +0200 Commit: Olivier Hallot CommitDate: Sat Apr 27 15:36:58 2019 +0200 Monitoring document events with Python & Basic -Mutual help pages x-refs -tree addition -new bookmarks for --Advanced Basic Libraries --Appl. Progr. Interface NB: I wish I could create new in gerrit OH: moved new xhp to right position New image Update makefiles several x-ref fixes libO: Added language-driven and tags for 3 different img captures that XHP Editor doesn't propose but that are documented Couldn't validate such switches.. crossing fingers.. OH: Languages are not switchable, as explained in comments. Removed reference to image for good (not l10n full support). fix missing apostrophe. Change-Id: I97c92fc879df19f9e8de73e828cd3324ba2163fa Reviewed-on: https://gerrit.libreoffice.org/70896 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index c4d4a0c14..90736b80f 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -371,6 +371,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/vbasupport \ helpcontent2/source/text/sbasic/python/main \ 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_ide \ helpcontent2/source/text/sbasic/python/python_import \ diff --git a/source/text/sbasic/python/python_document_events.xhp b/source/text/sbasic/python/python_document_events.xhp new file mode 100644 index 0..e2cf4562a --- /dev/null +++ b/source/text/sbasic/python/python_document_events.xhp @@ -0,0 +1,279 @@ + + + + + + Python : Monitoring Document Events + /text/sbasic/python/python_document_events.xhp + + + + + Basic;Monitoring Document Events + Python;Monitoring Document Events + + Access2Base;Console + Access2Base;Trace + Tools;Strings + + API;BasicLibraries + API;DocumentEvent + API;DocumentEventListener + API;EventObject + API;GlobalEventBroadcaster + API;MasterScriptProviderFactory + API;XDocumentEventBroadcaster + API;XDocumentEventListener + API;XScript + + + Monitoring Document Events + + Next to assigning macros to events, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts. + Listening to Document Events + Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning OnLoad script, to the Open Document event, suffices to initiate and terminate document event monitoring. Tools – Customise... menu Events tab is used to assign either scripts. + Intercepting events helps setting scripts pre- and post-conditions such as loading and unloading libraries or track script processing in the background. Access2Base Trace module usage is illustrating that second context. + With Python + Events monitoring starts from object instantiation and ultimately stops when Python releases the object. Raised events are reported using Access2Base console. + OnLoad and OnUnload events can be used to respectively set and unset Python programs path. They are described as Open document and Document closed. + + # -*- coding: utf-8 -*- + from __future__ import unicode_literals + + import os.path, uno, unohelper + from com.sun.star.document import DocumentEvent, \ + XDocumentEventListener as AdapterPattern + from com.sun.star.lang import EventObject + + class UiDocument(unohelper.Base, AdapterPattern): + """ Monitor document events """ + ''' + adapted from 'Python script to monitor OnSave event' at + https://forum.openoffice.org/en/forum/viewtopic.php?t=68
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/guide/sample_code.xhp |6 source/text/sbasic/python/python_examples.xhp|2 source/text/sbasic/python/python_listener.xhp| 163 +++ source/text/sbasic/python/python_programming.xhp |2 5 files changed, 170 insertions(+), 4 deletions(-) New commits: commit 4ff9ffa9f74290ecc8dae66034e16fda64aa369f Author: LibreOfficiant AuthorDate: Mon Apr 8 15:38:23 2019 +0100 Commit: Olivier Hallot CommitDate: Wed Apr 10 16:32:54 2019 +0200 New Python page + updates to existing pages to support embedded references Change-Id: Ie7bd884db45e3ca59dee1ffa79b2ea14ced3d160 Reviewed-on: https://gerrit.libreoffice.org/70420 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 9325e065f..c4d4a0c14 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -374,6 +374,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/python_examples \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_import \ +helpcontent2/source/text/sbasic/python/python_listener \ helpcontent2/source/text/sbasic/python/python_locations \ helpcontent2/source/text/sbasic/python/python_platform \ helpcontent2/source/text/sbasic/python/python_programming \ diff --git a/source/text/sbasic/guide/sample_code.xhp b/source/text/sbasic/guide/sample_code.xhp index 334d88cd0..cc3ab51d8 100644 --- a/source/text/sbasic/guide/sample_code.xhp +++ b/source/text/sbasic/guide/sample_code.xhp @@ -39,8 +39,10 @@ examples; programming controls dialog editor;programming examples for controls -Programming Examples for Controls in the Dialog Editor - + + Programming Examples for Controls in the Dialog Editor + + The following examples are for a new dialog called "Dialog1". Use the tools on the Toolbox bar in the dialog editor to create the dialog and add the following controls: a Check Box called "CheckBox1", a Label Field called "Label1", a Button called "CommandButton1", and a List Box called "ListBox1". Be consistent with uppercase and lowercase letter when you attach a control to an object variable. Global Function for Loading Dialogs diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 779bfddef..2fadd429c 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -28,13 +28,13 @@ + diff --git a/source/text/sbasic/python/python_listener.xhp b/source/text/sbasic/python/python_listener.xhp new file mode 100644 index 0..3a0796f7f --- /dev/null +++ b/source/text/sbasic/python/python_listener.xhp @@ -0,0 +1,163 @@ + + + + + + Python Listeners : Creating Event Listeners + /text/sbasic/python/python_listener.xhp + + + + + Python;Event Listener + Python;createUnoListener + Basic;Event Listener + + + Creating Event Listeners + + Events raised by dialogs, documents, forms or graphical controls can be linked to macros, which is referred to as event-driven programming. The most common method to relate events to macros are the Events tab in Tools – Customize menu and the Dialog Editor Control properties pane from Tools - Macros – Organise Dialogs... menu. + Graphical artifacts, keyboard inputs, mouse moves and other man/machine interactions can be controlled using UNO listeners that watch for the user’s behaviour. Listeners are dynamic program code alternatives to macro assignments. One may create as many UNO listeners as events to watch for. A single listener can also handle multiple user interface controls. + Creating an event listener + Listeners get attached to controls held in dialogs, as well as to document or form events. Listeners are also used when creating runtime dialogs or when adding controls to a dialog on the fly. + This example creates a listener for Button1 control of Dialog1 dialog in Standard library. + With Python + + # -*- coding: utf-8 -*- + from __future__ import unicode_literals + + import uno, unohelper + from com.sun.star.awt import XActionListener + from com.sun.star.awt import ActionEvent + from com.sun.star.lang import EventObject + from com.sun.star.ui.dialogs.ExecutableDialogResults \ + import OK, CANCEL + import msgbox as util + + _MY_BUTTON = "Button1" + _MY_LABEL = 'Python listens..' + _DLG_PROVIDER = "com.sun.star.awt.DialogProvider" + + def Main(*args): + ui = createUnoDialog("Sta
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/python/python_dialogs.xhp | 76 ++ source/text/sbasic/python/python_examples.xhp |2 3 files changed, 78 insertions(+), 1 deletion(-) New commits: commit 5489ccad66f7bb892c09c68baa9d38b351c01b59 Author: Alain Romedenne AuthorDate: Wed Feb 20 13:22:05 2019 -0300 Commit: Olivier Hallot CommitDate: Thu Feb 21 16:22:07 2019 +0100 Python: Help pages on opening dialogs Change-Id: Ib71ad229ff908c1bb7c426f2242729d53cb01ff8 Reviewed-on: https://gerrit.libreoffice.org/68100 Tested-by: Jenkins Reviewed-by: LibreOfficiant Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index bc44ddbce..859e79439 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -369,6 +369,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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_dialogs \ helpcontent2/source/text/sbasic/python/python_examples \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_import \ diff --git a/source/text/sbasic/python/python_dialogs.xhp b/source/text/sbasic/python/python_dialogs.xhp new file mode 100644 index 0..2ba1ad81f --- /dev/null +++ b/source/text/sbasic/python/python_dialogs.xhp @@ -0,0 +1,76 @@ + + + + + +Python : Opening a Dialog +/text/sbasic/python/python_dialogs.xhp + + + + +Python;dialogs +dialog box;Python +dialogs;Python + + +Opening a Dialog in Python + +%PRODUCTNAME static dialogs are created with the Dialog editor and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from on Basic or Python scripts, or using any other %PRODUCTNAME supported language for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity. +My Macros or %PRODUCTNAME Macros dialogs +The examples below open Access2Base Trace console or the imported TutorialsDialog dialog with Tools – Macros – Run Macro... menu: + +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +def consoleDlg(): +ctx =XSCRIPTCONTEXT.getComponentContext() +smgr = ctx.getServiceManager() +dp = smgr.createInstanceWithContext("com.sun.star.awt.DialogProvider", ctx) +dlg = dp.createDialog( "vnd.sun.star.script:Access2Base.dlgTrace?location=application") + dlg.execute() + dlg.dispose() + +def tutorDialog(): +ctx =XSCRIPTCONTEXT.getComponentContext() +smgr = ctx.getServiceManager() +dp = smgr.createInstanceWithContext("com.sun.star.awt.DialogProvider", ctx) +dlg = dp.createDialog("vnd.sun.star.script:Standard.TutorialsDialog?location=application") + dlg.execute() + dlg.dispose() + +g_exportedScripts = (consoleDlg, tutorDialog) + +Document embedded dialogs +The example below opens a newly edited Dialog1 dialog from a document with Tools – Macros – Run Macro... menu: + +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +def docDialog(): +""" Display a doc-based dialog """ +model = XSCRIPTCONTEXT.getDocument() +smgr = XSCRIPTCONTEXT.getComponentContext().ServiceManager +dp = smgr.createInstanceWithArguments( "com.sun.star.awt.DialogProvider", (model,)) +dlg = dp.createDialog( "vnd.sun.star.script:Standard.Dialog1?location=document") + dlg.execute() + dlg.dispose() + +g_exportedScripts = (docDialog,) + + + +Refer to msgbox.py in <$installation>/program/ directory for an example of Python dynamic dialogs. + + + + + + diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 3dd1c5564..779bfddef 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -28,13 +28,13 @@ + ___ 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/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/python/python_examples.xhp |2 source/text/sbasic/python/python_import.xhp | 118 ++ 3 files changed, 120 insertions(+), 1 deletion(-) New commits: commit 675b040e842403b91e2246ed78c6016ef10ddd0d Author: --author=Alain Romedenne AuthorDate: Wed Feb 13 11:31:15 2019 -0200 Commit: Olivier Hallot CommitDate: Thu Feb 14 13:20:40 2019 +0100 Python: Help page for module import Change-Id: I35ce948bbd0abcb2daeb272fe4d436cd05bb24ed Reviewed-on: https://gerrit.libreoffice.org/67773 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 81718f70e..bc44ddbce 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -371,6 +371,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/main \ helpcontent2/source/text/sbasic/python/python_examples \ helpcontent2/source/text/sbasic/python/python_ide \ +helpcontent2/source/text/sbasic/python/python_import \ helpcontent2/source/text/sbasic/python/python_locations \ helpcontent2/source/text/sbasic/python/python_platform \ helpcontent2/source/text/sbasic/python/python_programming \ diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 067f239df..bdfb2488a 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -33,7 +33,7 @@ --> - + diff --git a/source/text/sbasic/python/python_import.xhp b/source/text/sbasic/python/python_import.xhp new file mode 100644 index 0..3ac240d87 --- /dev/null +++ b/source/text/sbasic/python/python_import.xhp @@ -0,0 +1,118 @@ + + + + + +Python : Importing Modules +/text/sbasic/python/python_import.xhp + + + + +Python;import +Python;Modules +Python;pythonpath +PythonLibraries + +Importing Python Modules +LibreOffice Python scripts come in three distinct flavors, they can be personal, shared or embedded in documents. They are stored in varying places described in Python Scripts Organization and Location. In order to import Python modules, their locations must be known from Python at run time. +This mechanism is illustrated for file system based modules and document based modules. Exception handling is omitted for clarity. The terms library or directory, scripts or modules are used interchangeably. A Python macro refers to a function inside a module. +Note that/Scripts/python/pythonpath local directory is always explored when running a Python macro from /Scripts/python. +File System module import + +User or Shared Modules +Personal & shared Python scripts can be imported once their directories are included in Python run time path. Refer to Getting session information page for more details regarding omitted Session Class. + +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +import sys + +user_lib = Session().UserPythonScripts # User scripts location +if not user_lib in sys.path: + sys.path.insert(0, user_lib) # Add to search path +import screen_io as ui # 'screen_io.py' module resides in user_lib directory +# Your code follows here + +This Python example exposes a local XSCRIPTCONTEXT variable to an imported module: + +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +import uno, sys + +share_lib = Session.SharedPythonScripts() # Shared scripts location +if not share_lib in sys.path: + sys.path.insert(0, share_lib) # Add to search path +from IDE_utils import ScriptContext # 'IDE_utils.py' sits with shared Python scripts. +XSCRIPTCONTEXT = ScriptContext(uno.getComponentContext) +# Your code follows here + +Installation Modules for Applications +Unlike personal and shared scripts, %PRODUCTNAME installation scripts can be imported any time. Next to uno & unohelper %PRODUCTNAME Python modules, other scripts present in /program directory can be imported directly, such as the msgbox module. +With Python shell: +>>> import msgbox, uno +>>> myBox = msgbox.MsgBox(uno.getComponentContext()) +>>> myBox.addButton("okay") +>>> myBox.renderFromButtonSize() +>>> myBox.numberOflines = 2 +>>> print(myBox.show("A small message",0,"Dialog title")) +Document Module Import +Importing a Python document embedded module is illustrated below. Error handling is not detailed. Python run time path is updated when document has been opened and before closu
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/python/python_session.xhp | 160 +++ 2 files changed, 161 insertions(+) New commits: commit ae3c8a0a8a17b5cd3c427d7c62a4832631e18bb2 Author: Alain Romedenne AuthorDate: Thu Jan 31 14:51:22 2019 +0100 Commit: Olivier Hallot CommitDate: Fri Feb 1 13:25:59 2019 +0100 Add Help page for Python session Change-Id: I01f1448176f5c95a5151bb3040e9c2ef53fcb7f1 Reviewed-on: https://gerrit.libreoffice.org/67214 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index e8c2c202f..81718f70e 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -375,6 +375,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/python_platform \ helpcontent2/source/text/sbasic/python/python_programming \ helpcontent2/source/text/sbasic/python/python_screen \ +helpcontent2/source/text/sbasic/python/python_session \ helpcontent2/source/text/sbasic/python/python_shell \ )) diff --git a/source/text/sbasic/python/python_session.xhp b/source/text/sbasic/python/python_session.xhp new file mode 100644 index 0..e6a49c91e --- /dev/null +++ b/source/text/sbasic/python/python_session.xhp @@ -0,0 +1,160 @@ + + + + + +Python_Session : Session class +/text/sbasic/python/python_session.xhp + + + + +Session;ComputerName +Session;SharedScripts +Session;SharedPythonScripts +Session;UserProfile +Session;UserScripts +Session;UserPythonScripts + +Getting session information +To compute %PRODUCTNAME user profile and shared modules system file paths can be performed with Python and with Basic language. BeanShell, Java, JavaScript and Python scripts locations can be derived from this information. +Examples: +With Python shell. +>>> fromimport Session +>>> print(Session.SharedPythonScripts()) # class method +>>> print(Session().UserName) # object property +>>> input(Session().UserProfile) # object property +From Tools – Macros - Run Macro... menu. + +from import Session + +def demo_session(): +import screen_io as ui + ui.MsgBox(Session.Share(),title='Installation Share') # class method + ui.Print(Session.SharedPythonScripts()) # class method +s = Session() # instance creation + ui.MsgBox(s.UserName,title='Hello') # object property + ui.Print(s.UserPythonScripts) # object property + +g_exportedScripts = demo_session, # public macros + +With %PRODUCTNAME Basic. + +Sub Session_example() +Dim s As New Session ' instance of Platform class +Print "Shared scripts location:", s.SharedScripts +MsgBox s.UserName,,"Hello" +Print s.UserScripts, Chr(13), s.UserPythonScripts +End Sub ' Session_example + +Using COM/OLE and Visual Basic Scripting language. + +' The service manager is always the entry point +' If there is no office running then an office is started up +Set sm = WScript.CreateObject("com.sun.star.ServiceManager") +' PathSubstitution service exhibits information to infer +' /Scripts/python locations from +Set obj = sm.createInstance("com.sun.star.util.PathSubstitution") + +MsgBox CreateObject("WScript.Network").UserName,, "Hello" +user = obj.getSubstituteVariableValue("$(user)") +MsgBox user & "/Scripts",, "User scripts location" +libO = Replace(obj.getSubstituteVariableValue("$(inst)"), "program/..", "Share") +MsgBox libO & "/Scripts",, "Shared scripts location" + +Python Session class: + +import getpass, os, os.path, uno + +class Session(): + @staticmethod +def substitute(var_name): +ctx = uno.getComponentContext() +ps = ctx.getServiceManager().createInstanceWithContext( + 'com.sun.star.util.PathSubstitution', ctx) +return ps.getSubstituteVariableValue(var_name) + @staticmethod +def Share(): +inst = uno.fileUrlToSystemPath(Session.substitute("$(prog)")) +return os.path.normpath(inst.replace('program', "Share")) + @staticmethod +def SharedScripts(): +return ''.join([Session.Share(), os.sep, "Scripts"]) + @staticmethod +def SharedPythonScripts(): +return ''.join([Session.SharedScripts(), os.sep, 'python']) +@property # alternative to '$(username)' variable +def UserName(self): return g
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/python/python_examples.xhp |7 - source/text/sbasic/python/python_platform.xhp | 117 + source/text/sbasic/shared/03132100.xhp |2 source/text/sbasic/shared/GetPathSeparator.xhp |4 5 files changed, 125 insertions(+), 6 deletions(-) New commits: commit de5dad498afaadc2308ee247f26aa6f9b14a3d66 Author: Alain Romedenne AuthorDate: Tue Jan 22 23:40:10 2019 -0200 Commit: Olivier Hallot CommitDate: Wed Jan 23 12:39:28 2019 +0100 Add more python examples Change-Id: Id34674cd96d615b8613a35e18d96886a3d39bae0 Reviewed-on: https://gerrit.libreoffice.org/66763 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index cc08cf424..16cac3877 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -369,6 +369,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/python_examples \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_locations \ +helpcontent2/source/text/sbasic/python/python_platform \ helpcontent2/source/text/sbasic/python/python_programming \ helpcontent2/source/text/sbasic/python/python_screen \ helpcontent2/source/text/sbasic/python/python_shell \ diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 40c00f8e3..085f9ddad 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -31,10 +31,11 @@ - - --> + + + - + diff --git a/source/text/sbasic/python/python_platform.xhp b/source/text/sbasic/python/python_platform.xhp new file mode 100644 index 0..5127069fb --- /dev/null +++ b/source/text/sbasic/python/python_platform.xhp @@ -0,0 +1,117 @@ + + + + + +Python : Platform class +/text/sbasic/python/python_platform.xhp + + + + +Platform;isLinux +Platform;isMacOsX +Platform;isWindows +Platform;ComputerName +Platform;OSName + +Identifying the operating system +Identifying the operating system can be performed with Python or Basic language. +%PRODUCTNAME Basic lacks Mac OS X native recognition while ComputerName property is solely available for Windows. Basic calls to Python macros help overcome such limitations. +Using a Python class: + +import os, platform +class Platform(): + @property +def ComputerName(self): return platform.node() + @property +def DirSeparator(self): return os.sep + @property +def isLinux(self): return (self.OSName=='Linux') + @property +def isMacOSX(self): return (self.OSName=='Darwin') + @property +def isWindows(self): return (self.OSName=='Windows') + @property +def OSName(self): return platform.system() + @property +def PathDelimiter(self): return os.pathsep + +Using a Basic classmodule: + +Option Compatible +Option ClassModule +Option Explicit + +Public Property Get ComputerName As String +If isWindows Then ComputerName = Environ("ComputerName") +End Property ' Platform.ComputerName + +Public Property Get DirSeparator As String +DirSeparator = GetPathSeparator() +End Property ' Platform.DirSeparator + +Public Property Get IsLinux As Boolean +isLinux = ( GetGUIType()=4 ) ' Applies to Mac OS X as well +End Property ' Platform.isLinux + +Public Property Get IsWindows As Boolean +isWindows = ( GetGUIType()=1 ) +End Property ' Platform.isWindows + +Public Property Get OSName As String +Select Case GetGUIType() +Case 1 : OSName = "Windows" +Case 4 : OSName = "Linux" + End Select +End Property ' Platform.OSName + +Public Property Get PathDelimiter As String +Select Case OSName +Case "Linux" : PathDelimiter = ":" +Case "Windows" : PathDelimiter = ";" + End Select +End Property ' Platform.PathDelimiter + +Examples: +With Python +>>> fromimport Platform +>>> print(Platform().isMacOSX) # object property +True +>>> input(Platform().OSName) # object property +Darwin + +From Tools – Macros - Run Macro... menu. + +from import Platform +import screen_io as ui +p = Platform() +ui.MsgBox(''.joi
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/python/python_examples.xhp |5 - source/text/sbasic/python/python_screen.xhp | 104 ++ source/text/sbasic/shared/0301.xhp|4 - 4 files changed, 109 insertions(+), 5 deletions(-) New commits: commit f601cf7f5da7ff3986cde52b34962c56b00fd5f6 Author: Alain Romedenne AuthorDate: Wed Jan 16 11:20:08 2019 -0200 Commit: Olivier Hallot CommitDate: Fri Jan 18 11:06:27 2019 +0100 Python Help page for screen IO Change-Id: I0a1fc11a23c6f48eb058d42541e1f22c57ddb26d Reviewed-on: https://gerrit.libreoffice.org/66442 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index b76014f32..cc08cf424 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -370,6 +370,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_locations \ helpcontent2/source/text/sbasic/python/python_programming \ +helpcontent2/source/text/sbasic/python/python_screen \ helpcontent2/source/text/sbasic/python/python_shell \ )) diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 86e2aac53..40c00f8e3 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -21,6 +21,7 @@ Python;shell Python;platform Python;session +Python;screen input/output Python programming examples @@ -32,8 +33,8 @@ - - --> + + diff --git a/source/text/sbasic/python/python_screen.xhp b/source/text/sbasic/python/python_screen.xhp new file mode 100644 index 0..a3d8077ee --- /dev/null +++ b/source/text/sbasic/python/python_screen.xhp @@ -0,0 +1,104 @@ + + + + + +Python : Screen Input/Output +/text/sbasic/python/python_screen.xhp + + + + +Python;InputBox +Python;MsgBox +Python;Print + +Input/Output to Screen +Python standard output file is not available when running Python macros from Tools – Macros - Run Macro... menu. Presenting the output of a module requires the Python interactive console. Features such as input(), print(), repr() and str() are available from the Python shell. +The https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python"; name ="apso">Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module. +%PRODUCTNAME Basic proposes InputBox(), Msgbox() and Print() screen I/O functions. Python alternatives exist relying either on %PRODUCTNAME API Abstract Windowing Toolkit, either on Python to Basic function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. The API Scripting Framework is used to perform Basic, Beanshell, JavaScript and Python inter-languages function calls. +Python syntax: +MsgBox(txt, buttons=0, title=None) +InputBox(txt, title=None, default=None) +Print(txt) +Examples: +>>> import screen_io as ui +>>> reply = ui.InputBox('Please enter a phrase', title='Dear user', default="here..") +>>> rc = ui.MsgBox(reply, title="Confirmation of phrase") +>>> age = ui.InputBox('How old are you?', title="Hi") +>>> ui.Print(age) +Installation: + + +Copy screen_io Python module in My macros within/Scripts/python/pythonpath, + + +Copy uiScripts Basic module in My macros Standard Basic library, + + +Restart %PRODUCTNAME. + + +screen_io Python module + +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +def MsgBox(prompt: str, buttons=0, title='LibreOffice') -> int: +""" Displays a dialogue box containing a message and returns a value.""" +xScript = _getScript("_MsgBox") +res = xScript.invoke((prompt,buttons,title), (), ()) +return res[0] + +def InputBox(prompt: str, title='LibreOffice', defaultValue='') -> str: +""" Displays a prompt in a dialogue box at which the user can enter text.""" +xScript = _getScript("_InputBox") +res = xScript.invoke((prompt,title,defaultValue), (), ()) +return res[0] + +def Print(message: str): +"""Outputs the specified strings or numeric expressions in a dialogue box.""" +xScript = _getScript("_Print") + xScript.invoke((message,), (), ()) + +import uno +from com.
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/python/main.xhp|1 source/text/sbasic/python/python_examples.xhp | 39 ++ 3 files changed, 41 insertions(+) New commits: commit b01f85baef364236cb68dd0dbeb0bcb7513bd85c Author: Alain Romedenne AuthorDate: Fri Jan 4 17:36:06 2019 -0200 Commit: Olivier Hallot CommitDate: Fri Jan 4 20:54:18 2019 +0100 tdf#121736 More Help pages on Python Entry page for examples. Comments left intentionally for later fill. Change-Id: Ifacad703097187180cc3909be4ba9a81f80244be Reviewed-on: https://gerrit.libreoffice.org/65866 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 61a7fa5d9..b76014f32 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -366,6 +366,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ 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_examples \ helpcontent2/source/text/sbasic/python/python_ide \ helpcontent2/source/text/sbasic/python/python_locations \ helpcontent2/source/text/sbasic/python/python_programming \ diff --git a/source/text/sbasic/python/main.xhp b/source/text/sbasic/python/main.xhp index 05f9abcc9..d4d33b54d 100644 --- a/source/text/sbasic/python/main.xhp +++ b/source/text/sbasic/python/main.xhp @@ -34,6 +34,7 @@ Creating a dialog + Programming Examples diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp new file mode 100644 index 0..8e3dd253a --- /dev/null +++ b/source/text/sbasic/python/python_examples.xhp @@ -0,0 +1,39 @@ + + + + + +Python examples +/text/sbasic/python/python_examples.xhp + + + + + +Python;examples +Python;shell +Python;platform +Python;session + +Python programming examples + + + + ___ 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/text
AllLangHelp_sbasic.mk|1 source/text/sbasic/python/main.xhp |5 source/text/sbasic/python/python_programming.xhp | 292 +++ 3 files changed, 295 insertions(+), 3 deletions(-) New commits: commit 4df68585db8f4c74a1d74c6d7bc97bfb0c18f36f Author: Alain Romedenne AuthorDate: Wed Jan 2 20:40:03 2019 -0200 Commit: Olivier Hallot CommitDate: Thu Jan 3 11:45:06 2019 +0100 tdf#121736 Python programming Help pages Change-Id: I6307a9f5e5ae27931ca12d8268d825afcee58539 Reviewed-on: https://gerrit.libreoffice.org/65828 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index f9b8f4b93..61a7fa5d9 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -368,6 +368,7 @@ $(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/python/python_programming \ helpcontent2/source/text/sbasic/python/python_shell \ )) diff --git a/source/text/sbasic/python/main.xhp b/source/text/sbasic/python/main.xhp index cd2cbf935..05f9abcc9 100644 --- a/source/text/sbasic/python/main.xhp +++ b/source/text/sbasic/python/main.xhp @@ -27,13 +27,12 @@ This help section explains the most common Python script functions for %PRODUCTNAME. For more in-depth information please refer to the https://wiki.documentfoundation.org/Macros/Python_Design_Guide"; name="wiki.documentfoundation.org PYTHON Guide">Designing & Developing Python Applications on the Wiki. -Working with Python Scripts in %PRODUCTNAME. +Working with Python Scripts in %PRODUCTNAME You can execute Python scripts choosing Tools - Macros – Run macro Editing scripts can be done with your preferred text editor. Python scripts are present in various locations detailed hereafter. You can refer to Programming examples for macros illustrating how to run Python interactive console from %PRODUCTNAME . -Programming with Python Scripts - + Creating a dialog Programming Examples diff --git a/source/text/sbasic/python/python_programming.xhp b/source/text/sbasic/python/python_programming.xhp new file mode 100644 index 0..46d9d90c1 --- /dev/null +++ b/source/text/sbasic/python/python_programming.xhp @@ -0,0 +1,292 @@ + + + + + +Python : Programming with Python +/text/sbasic/python/python_programming.xhp + + + + +Python;Programming +XSCRIPTCONTEXT;Python +uno.py + + +Programming with Python Scripts + +A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of UNO objects functions or services, Python macros use the XSCRIPTCONTEXT UNO single object, shared with JavaScript and Beanshell. The g_exportedScripts global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another. +XSCRIPTCONTEXT Global Variable +Genuine Basic UNO facilities can be inferred from XSCRIPTCONTEXT global variable. Refer to %PRODUCTNAME API for a complete https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html"; name ="external">description of XSCRIPTCONTEXT. XSCRIPTCONTEXT methods summarize as: + + + +Methods + + +Description + + +Mapped in Basic as + + + + +getDocument() + + +The document reference on which the script can operate. + + +ThisComponent + + + + +getDesktop() + + +The desktop reference on which the script can operate. + + +StarDesktop + + + + +getComponentContext() + + +The component context which the script can use to create other uno components. + + +GetDefaultContext + + + +HelloWorld and Capitalise installation shared scripts illustrate UNO-related macros making use of XSCRIPTCONTEXT global variable. +Python standard output file is not available when running Python macros from Tools - Macros - Run Macro menu. Refer to Input/Output to Screen for more information. +Module import +XSCRIPTCONTEXT is not provided to imported modules. + +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |2 ++ source/text/sbasic/shared/uno_objects.xhp |5 + 2 files changed, 7 insertions(+) New commits: commit 44ca55be293c97d713c83d9917e78950b6e63f8e Author: Olivier Hallot AuthorDate: Fri Dec 14 10:16:40 2018 -0200 Commit: Olivier Hallot CommitDate: Fri Dec 14 16:50:20 2018 +0100 Fix missing entry in makefile + bookmarks Change-Id: I836964a1ec29485ee05617cce486dadd5b009591 Reviewed-on: https://gerrit.libreoffice.org/65161 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 303228599..11c686abe 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -355,6 +355,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/enum \ +helpcontent2/source/text/sbasic/shared/uno_objects \ +helpcontent2/source/text/sbasic/shared/stardesktop \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ diff --git a/source/text/sbasic/shared/uno_objects.xhp b/source/text/sbasic/shared/uno_objects.xhp index ccdb4a560..67a0c8977 100644 --- a/source/text/sbasic/shared/uno_objects.xhp +++ b/source/text/sbasic/shared/uno_objects.xhp @@ -16,6 +16,11 @@ + +programming;UNO objects +UNO objects +UNO functions + 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/text
AllLangHelp_sbasic.mk |5 source/text/sbasic/shared/0003.xhp | 14 +- source/text/sbasic/shared/03090400.xhp |2 source/text/sbasic/shared/03090411.xhp |4 source/text/sbasic/shared/03090413.xhp | 62 source/text/sbasic/shared/0310.xhp |3 source/text/sbasic/shared/0315.xhp | 140 source/text/sbasic/shared/03150001.xhp | 173 + source/text/sbasic/shared/0316.xhp | 77 +++ source/text/sbasic/shared/0317.xhp | 71 ++ source/text/sbasic/shared/special_vba_func.xhp | 56 11 files changed, 569 insertions(+), 38 deletions(-) New commits: commit 3de74ecadfd9a7529e1b0b05352e42a829d3e279 Author: Olivier Hallot Date: Sat Dec 2 09:58:11 2017 -0200 tdf#84675 VBA functions documentation Plus some addition for Type statement Change-Id: I9a1aa6a948cd50181fba07c105a25d986b372d02 Reviewed-on: https://gerrit.libreoffice.org/45709 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index f1c388e8e..5f8df59a0 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -214,6 +214,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03090410 \ helpcontent2/source/text/sbasic/shared/03090411 \ helpcontent2/source/text/sbasic/shared/03090412 \ +helpcontent2/source/text/sbasic/shared/03090413 \ helpcontent2/source/text/sbasic/shared/0310 \ helpcontent2/source/text/sbasic/shared/03100050 \ helpcontent2/source/text/sbasic/shared/03100060 \ @@ -337,6 +338,10 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140010 \ helpcontent2/source/text/sbasic/shared/03140011 \ helpcontent2/source/text/sbasic/shared/03140012 \ +helpcontent2/source/text/sbasic/shared/0315 \ +helpcontent2/source/text/sbasic/shared/03150001 \ +helpcontent2/source/text/sbasic/shared/0316 \ +helpcontent2/source/text/sbasic/shared/0317 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/keys \ diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index cebb51745..171d36ad6 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -31,7 +31,7 @@ Information -You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences +You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences Tools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting. @@ -189,8 +189,6 @@ Syntax: - - Return value: @@ -205,8 +203,12 @@ Example: -VBA financial functions - + +VBA financial functions +VBA Time and Date functions +VBA I/O functions +VBA Mathematical functions +VBA Object functions @@ -338,4 +340,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03090400.xhp b/source/text/sbasic/shared/03090400.xhp index c420483bb..02acc326f 100644 --- a/source/text/sbasic/shared/03090400.xhp +++ b/source/text/sbasic/shared/03090400.xhp @@ -30,8 +30,6 @@ - - Further Statements Statements that do not belong to any of the other runtime categories are described here. diff --git a/source/text/sbasic/shared/03090411.xhp b/source/text/sbasic/shared/03090411.xhp index 6dcf9f92e..3677118b2 100644 --- a/source/text/sbasic/shared/03090411.xhp +++ b/source/text/sbasic/shared/03090411.xhp @@ -37,7 +37,9 @@ Syntax: -With Object Statement block End With +With Object + Statement block +End With Parameters: Use With and End With if you have several properties or methods for a single object. diff --git a/source/text/sbasic/shared/03090413.xhp b/source/text/sbasic/shared/03090413.xhp new file mode 100644 index 0..842f906aa --- /dev/null +++ b/source/text/sbasic/shared/03090413.xhp @@ -0,0 +1,62 @@ + + + + + + + + Type Statement [Runtime] + /text/sbasic/shared/03090413.xhp + + + + + + Type statement + + Type Statement [Runtime] + Define non-UNO data structures (structs). + + A struct is an ordered collect
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/03140002.xhp | 77 + source/text/sbasic/shared/special_vba_func.xhp |2 3 files changed, 79 insertions(+), 1 deletion(-) New commits: commit 538aa4791d07f40112953b5625a7dbba96d53105 Author: Olivier Hallot Date: Wed Jun 14 19:42:00 2017 -0300 tdf#84675 Add help page for IPmt function of VBA Change-Id: Iddb382d9735c25f2ca77f8141457fb6bb497a696 Reviewed-on: https://gerrit.libreoffice.org/38808 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4d8075d25..d2435e002 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -326,6 +326,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03132500 \ helpcontent2/source/text/sbasic/shared/0314 \ helpcontent2/source/text/sbasic/shared/03140001 \ +helpcontent2/source/text/sbasic/shared/03140002 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/keys \ diff --git a/source/text/sbasic/shared/03140002.xhp b/source/text/sbasic/shared/03140002.xhp new file mode 100644 index 0..a4ebc9cb3 --- /dev/null +++ b/source/text/sbasic/shared/03140002.xhp @@ -0,0 +1,77 @@ + + + + + + +IPmt Function [Runtime - VBA] +/text/sbasic/shared/03140002.xhp + + + + + + + + + IPmt function + + + +IPmt Function [Runtime - VBA] +Calculates the periodic amortizement for an investment with regular payments and a constant interest rate. + + + + + +IPmt(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 is the period, for which the compound interest is calculated. Period=NPER if compound interest for the last period is calculated. +NPer is the total number of periods, during which annuity is paid. +PV is the present cash value in sequence of payments. +FV (optional) is the desired value (future value) at the end of the periods. +Due (optional) is the due date for the periodic payments. +0 - the payment is due at the end of the period; +1 - the payment is due at the beginning of the period. + + + + + +Sub ExampleIPmt + Dim myIPmt As Double + myIPmt = IPmt(0.05,5,7,15000) + Print myIPmt ' returns -352.97 currency units. The compound interest during the fifth period (year) is 352.97 currency units. +End Sub + + + +IPMT 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 f42d5b8b2..582e2ce0e 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -73,7 +73,7 @@ FV -IPmt +IPmt IRR ___ 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/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/03140001.xhp | 76 + source/text/sbasic/shared/special_vba_func.xhp |2 3 files changed, 78 insertions(+), 1 deletion(-) New commits: commit 969c5806ff0d958e8dc19d1abe98a1493842e4ca Author: Olivier Hallot Date: Wed Jun 14 17:00:09 2017 -0300 tdf#84675 Add help page for FV function of VBA Change-Id: Ic1ac6629eed117d6d2ec8802162e69a45e599a0c Reviewed-on: https://gerrit.libreoffice.org/38802 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 8459df924..4d8075d25 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -325,6 +325,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03132400 \ helpcontent2/source/text/sbasic/shared/03132500 \ helpcontent2/source/text/sbasic/shared/0314 \ +helpcontent2/source/text/sbasic/shared/03140001 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/keys \ diff --git a/source/text/sbasic/shared/03140001.xhp b/source/text/sbasic/shared/03140001.xhp new file mode 100644 index 0..8246842a6 --- /dev/null +++ b/source/text/sbasic/shared/03140001.xhp @@ -0,0 +1,76 @@ + + + + + + +FV Function [Runtime - VBA] +/text/sbasic/shared/03140001.xhp + + + + + + + + + FV function + + + +FV Function [Runtime - VBA] +Returns the future value of an investment based on periodic, constant payments and a constant interest rate (Future Value). + + + + + +FV(Rate as Double, NPer as Double, Pmt as Double, [PV as Variant], [Due as Variant]) + + + +Double + + +Rate is the periodic interest rate. +NPer is the total number of periods (payment period). +Pmt is the annuity paid regularly per period. +PV (optional) is the (present) cash value of an 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. + + + + + +Sub ExampleFV + Dim myFV As Double + myFV = =FV(0.04, 2, 750, 2500) + Print myFV ' returns 4234.00 currency units. The value at the end of the investment is 4234.00 currency units. +End Sub + + + +FV function in CALC +VBA financial functions + + + + diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index 34296bdd9..f42d5b8b2 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -70,7 +70,7 @@ DDB -FV +FV IPmt ___ 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/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/0003.xhp | 15 +++-- source/text/sbasic/shared/0314.xhp | 75 + source/text/sbasic/shared/special_vba_func.xhp |2 4 files changed, 88 insertions(+), 5 deletions(-) New commits: commit 34c220bf13976b2ecaa8af9e0333b74b06d47bfe Author: Olivier Hallot Date: Wed Jun 14 16:02:26 2017 -0300 tdf#84675 Add help page for DDB function of VBA Change-Id: I769a4f0863ca73db776e3ab1fb7faf1f25f3b2f7 Reviewed-on: https://gerrit.libreoffice.org/38801 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index dc1039d08..8459df924 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -324,6 +324,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03132300 \ helpcontent2/source/text/sbasic/shared/03132400 \ helpcontent2/source/text/sbasic/shared/03132500 \ +helpcontent2/source/text/sbasic/shared/0314 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/keys \ diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index 47cd5d06d..aba070e22 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -31,7 +31,7 @@ Information -You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences +You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences Tools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting. @@ -180,13 +180,20 @@ - This function is enabled with the statement Option VBASupport 1 placed before the executable program code in a module. + +Syntax: +Return value: +Parameters: +Example: + + -Error Codes + +Error codes: @@ -314,4 +321,4 @@ - + \ No newline at end of file diff --git a/source/text/sbasic/shared/0314.xhp b/source/text/sbasic/shared/0314.xhp new file mode 100644 index 0..97cace90d --- /dev/null +++ b/source/text/sbasic/shared/0314.xhp @@ -0,0 +1,75 @@ + + + + + + +DDB Function [Runtime - VBA] +/text/sbasic/shared/0314.xhp + + + + + + + + + DDB function + + + +DDB Function [Runtime - VBA] +Returns the depreciation of an asset for a specified period using the arithmetic-declining method. + + + + + +DDB (Cost As Double, Salvage As Double, Life as Double, Period as Double, [Factor as Variant]) + + + +Double + + +Cost fixes the initial cost of an asset. +Salvage fixes the value of an asset at the end of its life. +Life is the number of periods (for example, years or months) defining how long the asset is to be used. +Period states the period for which the value is to be calculated. +Factor (optional) is the factor by which depreciation decreases. If a value is not entered, the default is factor 2. +Use this form of depreciation if you require a higher initial depreciation value as opposed to linear depreciation. The depreciation value gets less with each period and is usually used for assets whose value loss is higher shortly after purchase (for example, vehicles, computers). Please note that the book value will never reach zero under this calculation type. + + + + + +Sub ExampleDDB + Dim ddb_yr1 As Double + ddb_yr1 = DDB(75000,1,60,12,2) + Print ddb_yr1 ' returns 1,721.81 currency units. +End Sub + + + +DDB function in CALC +VBA financial functions + + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index 27598358e..34296bdd9 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -67,7 +67,7 @@ -DDB +DDB FV ___ 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/text
AllLangHelp_sbasic.mk |1 source/text/sbasic/shared/03120111.xhp |4 - source/text/sbasic/shared/03120411.xhp |2 source/text/sbasic/shared/03120412.xhp | 63 + source/text/sbasic/shared/special_vba_func.xhp | 50 +-- 5 files changed, 92 insertions(+), 28 deletions(-) New commits: commit 0351604e8d6b4e3d797bdf742ff81377eee46b96 Author: Olivier Hallot Date: Sat May 20 08:22:15 2017 -0300 tdf#84675 Add help page for StrReverse VBA Fixes some syntax definitions Mute l10n for VBA function names Change-Id: I06d7391a44b465339e3c82f333719488f7d843b2 Reviewed-on: https://gerrit.libreoffice.org/37854 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 48e8ca766..dc1039d08 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -303,6 +303,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03120402 \ helpcontent2/source/text/sbasic/shared/03120403 \ helpcontent2/source/text/sbasic/shared/03120411 \ +helpcontent2/source/text/sbasic/shared/03120412 \ helpcontent2/source/text/sbasic/shared/0313 \ helpcontent2/source/text/sbasic/shared/03130100 \ helpcontent2/source/text/sbasic/shared/03130500 \ diff --git a/source/text/sbasic/shared/03120111.xhp b/source/text/sbasic/shared/03120111.xhp index 778258258..d220006ba 100644 --- a/source/text/sbasic/shared/03120111.xhp +++ b/source/text/sbasic/shared/03120111.xhp @@ -41,7 +41,7 @@ Syntax: -AscW (Text As String) as Integer +AscW (Text As String) Return value: @@ -69,4 +69,4 @@ - + \ No newline at end of file diff --git a/source/text/sbasic/shared/03120411.xhp b/source/text/sbasic/shared/03120411.xhp index ae0bd22e8..c0ab1daad 100644 --- a/source/text/sbasic/shared/03120411.xhp +++ b/source/text/sbasic/shared/03120411.xhp @@ -42,7 +42,7 @@ Syntax: -InStrRev (Text1 As String, Text2 As String [,Start As Long] [, Compare As Integer]) As Long +InStrRev (Text1 As String, Text2 As String [,Start As Long] [, Compare As Integer]) Return value: diff --git a/source/text/sbasic/shared/03120412.xhp b/source/text/sbasic/shared/03120412.xhp new file mode 100644 index 0..11c69947d --- /dev/null +++ b/source/text/sbasic/shared/03120412.xhp @@ -0,0 +1,63 @@ + + + + + + +StrReverse Function [Runtime - VBA] +/text/sbasic/shared/03120412.xhp + + + + + + + + + StrReverse function + + + +StrReverse Function [Runtime - VBA] +Returns the string with the character order reversed. + + + +Syntax: + +StrReverse (Text1 As String) + + +Return value: +String + +Parameters: + Text1: The string expression that you want to reverse the character order. + + + +Example: + +Sub ExampleReverse + Print StrReverse("ABCdefGH") ' return "HGfedCBA" +End Sub + + + + \ 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 541870cea..27598358e 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -35,9 +35,9 @@ Exclusive VBA functions -%PRODUCTNAME Basic supports these functions when VBA support is enabled +%PRODUCTNAME Basic adds this set of functions when VBA support is enabled -The following VBA functions are enabled when Option VBASupport 1 is the first line of a %PRODUCTNAME Basic module. +These exclusive VBA functions are enabled when Option VBASupport 1 is the first line of a %PRODUCTNAME Basic module. VBA Functions;Text Functions @@ -47,16 +47,16 @@ -AscW +AscW -ChrW +ChrW -InStrRev +InStrRev -StrReverse +StrReverse VBA Functions;Financial Functions @@ -67,43 +67,43 @@ -DDB +DDB -FV +FV -IPmt +IPmt -IRR +IRR -MIRR +MIRR -NPer +NPer -NPV +NPV -Pmt +Pmt -PPmt +PPmt -PV +PV -Rate +Rate -SLN +SLN -SYD +SYD VBA Functions;Date and Time Functions @@ -114,10 +114,10 @@ -FormatDateTime +FormatDateTime -WeekdayName +WeekdayName VBA Functions;I/O Functions @@ -128,7 +128,7 @@ -Input +Input VBA Functions;Mathematical Functions @@ -139,7 +139,7 @@ -Round +Round VBA Functions;Object Functions @@ -150,10 +150,10 @@ -Me +Me -RTL +RTL ___ 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/text
AllLangHelp_sbasic.mk |4 source/text/sbasic/shared/0003.xhp | 682 ++--- source/text/sbasic/shared/03120111.xhp | 72 ++ source/text/sbasic/shared/03120112.xhp | 72 ++ source/text/sbasic/shared/03120411.xhp | 80 ++ source/text/sbasic/shared/main0601.xhp |4 source/text/sbasic/shared/special_vba_func.xhp | 160 + source/text/sbasic/shared/vbasupport.xhp |5 8 files changed, 676 insertions(+), 403 deletions(-) New commits: commit eb145d19480d245228dc6b1032a925adbff8ea78 Author: Olivier Hallot Date: Fri May 19 11:12:14 2017 -0300 tdf#84675 Help VBA functions AscW, ChrW, InStrRev These functions are enabled whith Option VBASupport 1 fix bookmark Fix metas Fix makefile & add InStrRev Bookmarking Fix category for DDB Change-Id: I12fed1cd521ffb846d2994323013e8dcc127381f Reviewed-on: https://gerrit.libreoffice.org/37826 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 1be0b6bbe..48e8ca766 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -277,6 +277,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03120103 \ helpcontent2/source/text/sbasic/shared/03120104 \ helpcontent2/source/text/sbasic/shared/03120105 \ +helpcontent2/source/text/sbasic/shared/03120111 \ +helpcontent2/source/text/sbasic/shared/03120112 \ helpcontent2/source/text/sbasic/shared/03120200 \ helpcontent2/source/text/sbasic/shared/03120201 \ helpcontent2/source/text/sbasic/shared/03120202 \ @@ -300,6 +302,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03120401 \ helpcontent2/source/text/sbasic/shared/03120402 \ helpcontent2/source/text/sbasic/shared/03120403 \ +helpcontent2/source/text/sbasic/shared/03120411 \ helpcontent2/source/text/sbasic/shared/0313 \ helpcontent2/source/text/sbasic/shared/03130100 \ helpcontent2/source/text/sbasic/shared/03130500 \ @@ -325,6 +328,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/special_vba_func \ helpcontent2/source/text/sbasic/shared/vbasupport \ )) diff --git a/source/text/sbasic/shared/0003.xhp b/source/text/sbasic/shared/0003.xhp index 0035ea660..530de7268 100644 --- a/source/text/sbasic/shared/0003.xhp +++ b/source/text/sbasic/shared/0003.xhp @@ -1,6 +1,5 @@ - - + +--> - - -Information -/text/sbasic/shared/0003.xhp - - -Sun Microsystems, Inc. - + +Information +/text/sbasic/shared/0003.xhp + + -Information + + +Information + -You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - PreferencesTools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. -The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting. +You can set the locale used for controlling the formatting numbers, dates and currencies in $[officename] Basic in %PRODUCTNAME - Preferences +Tools - Options - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character. +The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting. + -The color values of the 16 basic colors are as follows: +The color values of the 16 basic colors are as follows: + - - - -Color Value - - - - -Color Name - - - - - -0 - - -Black - - - - -128 - - -Blue - - - - -32768 - - -Green - - - - -32896 - - -Cyan - - - - -8388608 - - -Red - - - - -8388736 - - -Magenta - - - - -8421376 - - -Yellow - - - - -8421504 - - -White - - - - -12632256 - - -Gray - - - - -255 - - -Light blue - - - - -65280 - - -Light green - - - - -65535 - - -Light cyan - - - - -16711680 - - -Light red - - - - -16711935 - - -Light magenta - - - - -16776960 - - -Light yellow - - - - -16777215 - - -Transparent white - - + + + Color Value + + + Color Name + + + + + 0 + + + Black + + + + + 128 + + + Blue + + + + + 32768 + + + Green + + + + + 32896 +
[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk source/text
AllLangHelp_sbasic.mk|2 source/text/sbasic/shared/03103350.xhp | 71 source/text/sbasic/shared/main0601.xhp | 38 source/text/sbasic/shared/vbasupport.xhp | 55 source/text/shared/optionen/01130100.xhp | 134 ++- 5 files changed, 227 insertions(+), 73 deletions(-) New commits: commit 6f947c50faf2969405749fc118659d9d9934eb91 Author: Olivier Hallot Date: Wed May 17 16:34:06 2017 -0300 tdf#84675 (part4) document VBA macros support Change-Id: I61f60fb4f3ac27604a71972f0c1d8a7e9effdcc4 Reviewed-on: https://gerrit.libreoffice.org/37735 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4ac32080b..1be0b6bbe 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -252,6 +252,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03103100 \ helpcontent2/source/text/sbasic/shared/03103200 \ helpcontent2/source/text/sbasic/shared/03103300 \ +helpcontent2/source/text/sbasic/shared/03103350 \ helpcontent2/source/text/sbasic/shared/03103400 \ helpcontent2/source/text/sbasic/shared/03103450 \ helpcontent2/source/text/sbasic/shared/03103500 \ @@ -324,6 +325,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/vbasupport \ )) # vim: set noet sw=4 ts=4: diff --git a/source/text/sbasic/shared/03103350.xhp b/source/text/sbasic/shared/03103350.xhp new file mode 100644 index 0..6cd1eb426 --- /dev/null +++ b/source/text/sbasic/shared/03103350.xhp @@ -0,0 +1,71 @@ + + + + + + +Option VBASupport Statement [Runtime] +/text/sbasic/shared/03103350.xhp + + + + + + + + + MS Excel macros support;Enable + MS Excel macros support;Option VBASupport statement + VBA Support;Option VBASupport statement + Option VBASupport statement + + + +Option VBASupport Statement [Runtime] +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. + +Syntax: + +Option VBASupport {1|0} + + +Parameters: +This statement must be added before the executable program code in a module. +1: Enable VBA support in %PRODUCTNAME +0: Disable VBA support + +Example: + +Option VBASupport 1 +Sub ExampleVBA +Dim sVar As Single + sVar = Worksheets("Sheet1").Range("A1") +Print sVar +End Sub + + + +VBA Properties +VBA support in %PRODUCTNAME + + + + \ No newline at end of file diff --git a/source/text/sbasic/shared/main0601.xhp b/source/text/sbasic/shared/main0601.xhp index 45324adca..e9e9e5016 100644 --- a/source/text/sbasic/shared/main0601.xhp +++ b/source/text/sbasic/shared/main0601.xhp @@ -1,6 +1,5 @@ - - + +--> - - - -$[officename] Basic Help -/text/sbasic/shared/main0601.xhp - - -Sun Microsystems, Inc. - + +$[officename] Basic Help +/text/sbasic/shared/main0601.xhp + + + -%PRODUCTNAME Basic Help + +%PRODUCTNAME Basic Help + -%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit http://api.libreoffice.org/"; name="http://api.libreoffice.org";>http://api.libreoffice.org -This help section explains the most common runtime functions of %PRODUCTNAME Basic. For more in-depth information please refer to the http://wiki.documentfoundation.org/Documentation/BASIC_Guide";>OpenOffice.org BASIC Programming Guide on the Wiki. +%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit http://api.libreoffice.org/"; name="http://api.libreoffice.org";>http://api.libreoffice.org +This help section explains the most common runtime functions of %PRODUCTNAME Basic. For more in-depth information please refer to the http://wiki.documentfoundation.org/Documentation/BASIC_Guide";>OpenOffice.org BASIC Programming Guide on the Wiki. -Working with %PRODUCTNAME Basic + +Working with %PRODUCTNAME Basic @@ -46,7 +45,9 @@ -Help about the Help + + +Help about the Help @@ -55,4 +56,5 @@ - + + \ No newline at end of file diff --git a/source/text/sbasic/shared/vbasupport.xhp b/source/text/sbasic/shared/vbasupport.xhp new file mode 100644 index 0..694afd33c --- /dev/null +++ b/source/