summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2021-07-19 14:00:18 +0200
committerJean-Pierre Ledure <jp@ledure.be>2021-07-21 12:49:35 +0200
commitaad9b295eab6bb3b6126ebda8e0b62b848369701 (patch)
treed3b8a2fe16538ba3ac11d6bfb94e5bec8b3d32b7
parentbd9131a3c09e8bd80820d923e73dc9daa247a1e1 (diff)
Python example in SF_Platform help page
Change-Id: I3889815d7eb2e653f307e9853649e395f4f2e2fb Reviewed-on: https://gerrit.libreoffice.org/c/help/+/119175 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
-rw-r--r--source/text/sbasic/shared/03/sf_platform.xhp29
1 files changed, 18 insertions, 11 deletions
diff --git a/source/text/sbasic/shared/03/sf_platform.xhp b/source/text/sbasic/shared/03/sf_platform.xhp
index ef534cc867..d1f5b61bc9 100644
--- a/source/text/sbasic/shared/03/sf_platform.xhp
+++ b/source/text/sbasic/shared/03/sf_platform.xhp
@@ -40,14 +40,21 @@
</section>
<note id="par_id951614903258253">All properties of the <literal>Platform</literal> service are read-only.</note>
<h2 id="hd_id281600788076359" xml-lang="en-US">Service invocation</h2>
- <paragraph role="paragraph" id="par_id321614902851541">The code snippet below instantiates the <literal>Platform</literal> service and accesses the <literal>Architecture</literal> property.</paragraph>
+ <paragraph role="paragraph" id="par_id321614902851541">The examples below in Basic and Python instantiate the <literal>Platform</literal> service and access the <literal>Architecture</literal> property.</paragraph>
+ <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
- <paragraph role="bascode" localize="false" id="bas_id851600788076202">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id1001600788076254">Dim platform As Variant</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id721600788076288">platform = CreateScriptService("Platform")</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id791600788431935">MsgBox platform.Architecture</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id851600788076202">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id1001600788076254">Dim platform As Variant</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id721600788076288">platform = CreateScriptService("Platform")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id791600788431935">MsgBox platform.Architecture</paragraph>
</bascode>
- <embed href="text/sbasic/shared/00000003.xhp#Python_Support"/>
+ <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id631626695710139">from scriptforge import CreateScriptService</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id981626695710433">svc = CreateScriptService("Platform")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id311626695710851">bas = CreateScriptService("Basic")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id391626695711082">bas.MsgBox(svc.Architecture)</paragraph>
+ </pycode>
<bookmark xml-lang="en-US" branch="index" localize="false" id="bm_id111614901524769">
<bookmark_value>Platform service;Architecture</bookmark_value>
<bookmark_value>Platform service;ComputerName</bookmark_value>
@@ -238,10 +245,10 @@
</table>
<embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
<section id="relatedtopics">
- <paragraph role="paragraph" id="par_id301613075694148"><link href="text/sbasic/python/python_platform.xhp" name="OS python">Identifying the operating system</link></paragraph>
- <paragraph role="paragraph" id="par_id301613065794148"><link href="text/scalc/01/04060104.xhp" name="Platform information with Calc INFO formula">Platform information with INFO("system") Calc formula</link></paragraph>
- <paragraph role="paragraph" id="par_id103613075694148"><link href="text/sbasic/shared/03132100.xhp" name="GetGuiType Function">GetGuiType function</link></paragraph>
- <paragraph role="paragraph" id="par_id301316075694148"><link href="text/sbasic/shared/03/lib_tools.xhp" name="Tools library">Tools library</link></paragraph>
+ <embed href="text/sbasic/python/python_platform.xhp#pythonplatform"/>
+ <paragraph role="paragraph" id="par_id301613065794148"><link href="text/scalc/01/04060104.xhp#bm_id3691824" name="Calc_Info">Platform information with INFO("system") Calc formula</link></paragraph>
+ <embed href="text/sbasic/shared/03132100.xhp#getguitype2"/>
+ <embed href="text/sbasic/shared/03/lib_tools.xhp#tools_lib"/>
</section>
</body>
-</helpdocument> \ No newline at end of file
+</helpdocument>