From 023b21a704bf0bae904b87907dd72d48d518ac09 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Thu, 18 Nov 2021 19:16:25 +0200 Subject: Document ScriptForge Dispose() method Change-Id: Ic2ff80cfc2dc987ea7e62d7c216358af279712a7 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/125452 Tested-by: Jenkins Reviewed-by: Alain Romedenne --- source/text/sbasic/shared/03/lib_ScriptForge.xhp | 31 +++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp b/source/text/sbasic/shared/03/lib_ScriptForge.xhp index 60a1026597..2d1c640a22 100644 --- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp +++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp @@ -25,20 +25,27 @@ 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:
+ • 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 Creating Python Scripts with 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 for each language: - - GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") - Set oSvc = CreateScriptService("servicename"[, arg0, arg1, ...]) - - - 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.
+ +

Invoking ScriptForge services

+ 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") + Set oSvc = CreateScriptService("servicename"[, arg0, arg1, ...]) + ' ... + oSvc.Dispose() + + + from scriptforge import CreateScriptService + svc = CreateScriptService('servicename'[, arg0, arg1, ...]) + # ... + svc.Dispose() + + The Dispose method is available in all services and should be called to free up resources after usage. +

Services provided by the ScriptForge library

@@ -200,7 +207,7 @@ Restricted use for SF_Root, SF_Utils modules as well as internal methods Note: Other ScriptForge undescribed modules are reserved for internal use. Their content is subject to change without notice.
- All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros. + All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros or Python scripts.
-- cgit v1.2.3