Context English Inuktitut
python_2_basic.xhp
N0341
help.text
<bookmark_value>API;script.provider.MasterScriptProviderFactory: Retrieving Basic scripts</bookmark_value><bookmark_value>API;script.provider.XScript: Executing Basic scripts</bookmark_value><bookmark_value>API;XScriptProvider: Retrieving Basic scripts</bookmark_value>
python_2_basic.xhp
N0347
help.text
'''Grab Basic script object before invocation.'''
python_2_basic.xhp
N0363
help.text
Executing %PRODUCTNAME Basic Scripts
python_2_basic.xhp
N0364ndx
help.text
<bookmark_value>API;script.provider.XScript : Executing Basic scripts</bookmark_value>
python_2_basic.xhp
N0364
help.text
The %PRODUCTNAME Software Development Kit (SDK) documentation for <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html#a11a551f5a2520f74c5109cd8c9f8c7b7" name="XScript interface">com.sun.star.script.provider.XScript</link> interface details the calling convention for inter-language calls. Invocation of functions requires three arrays:
python_2_basic.xhp
N0365
help.text
the first lists the arguments of the called routine
python_2_basic.xhp
N0366
help.text
the second identifies modified arguments
python_2_basic.xhp
N0367
help.text
the third stores the return values
python_2_basic.xhp
N0368
help.text
Python Syntax
python_2_basic.xhp
N0369
help.text
<literal>results = script.invoke((prompt,buttons,title), (), ())</literal>
python_2_basic.xhp
N0370
help.text
<literal>script.invoke((message,), tuple, ())</literal>
python_2_basic.xhp
N0371
help.text
<literal>script.invoke((args), (), results)</literal>
python_2_basic.xhp
N0372
help.text
Examples of Personal or Shared Scripts
python_2_basic.xhp
N0373
help.text
Examples in <link href="text/sbasic/python/python_screen.xhp" name="Input/Output to Screen">Input/Output to Screen</link> detail Python to Basic invocation calls. <link href="text/sbasic/python/python_document_events.xhp" name="Monitoring Document Events">Monitoring Document Events</link> illustrates the usage of *args Python idiom to print a variable number of parameters to <literal>Access2Base</literal> logging console dialog.
python_2_basic.xhp
N0374
help.text
At time of development you can interrupt Python script execution using <link href="https://berma.pagesperso-orange.fr/index2.html" name="Xray extension">Xray extension</link> in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions.
python_2_basic.xhp
N0378
help.text
Examples of Embedded Scripts in Documents
python_2_basic.xhp
N0379
help.text
<literal>*args</literal>Python simplified syntax can be used in conjunction with %PRODUCTNAME Basic routines that accept a variable number of arguments. Below <literal>Print</literal> and <literal>SUM</literal> Python functions call their Basic <literal>Print</literal> and <literal>SUM</literal> counterparts, using aforementioned <literal>getBasicScript</literal> function. Exception handling is not detailed.
python_2_basic.xhp
N0384
help.text
"""Outputs the specified strings or numeric expressions in a dialog box."""
python_2_basic.xhp
N0389
help.text
"""SUM the specified number expression."""
python_2_basic.xhp
N0402
help.text
The %PRODUCTNAME Basic <literal>Print</literal> and <literal>SUM</literal> document-based routines accept a variable number of arguments. The <literal>Private</literal> or <literal>Public</literal> attributes have no effect. The arguments type checking is skipped for clarity.