forked from amazingfate/help
Change-Id: Iad67f233d3448043bd30475a7a7c383c8e8dd1ca Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113217 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
246 lines
14 KiB
XML
246 lines
14 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<helpdocument version="1.0">
|
|
<!--
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
-->
|
|
<meta>
|
|
<topic id="SF_Platform" indexer="include" status="PUBLISH">
|
|
<title id="tit" xml-lang="en-US">ScriptForge.Platform service</title>
|
|
<filename>/text/sbasic/shared/03/sf_platform.xhp</filename>
|
|
</topic>
|
|
</meta>
|
|
<body>
|
|
<section id="ScriptForge-sf_platform">
|
|
<bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id501600788076381">
|
|
<bookmark_value>Platform service</bookmark_value>
|
|
</bookmark>
|
|
</section>
|
|
<section id="abstract">
|
|
<h1 id="bm_id681600788076499" xml-lang="en-US"><variable id="PlatformService"><link href="text/sbasic/shared/03/sf_platform.xhp" name="Platform service"><literal>ScriptForge</literal>.<literal>Platform</literal> service</link></variable></h1>
|
|
<paragraph role="paragraph" id="par_id181600788076612" xml-lang="en-US">The <literal>Platform</literal> service provides a collection of properties about the current execution environment and context, such as:</paragraph>
|
|
<list type="unordered">
|
|
<listitem>
|
|
<paragraph id="par_id301600788076785" role="listitem" xml-lang="en-US">The hardware platform (architecture, CPU count, machine type, etc)</paragraph>
|
|
</listitem>
|
|
<listitem>
|
|
<paragraph id="par_id1001600788076848" role="listitem" xml-lang="en-US">Operating system information (OS type, release, version, etc)</paragraph>
|
|
</listitem>
|
|
<listitem>
|
|
<paragraph id="par_id67160078807676" role="listitem" xml-lang="en-US">The %PRODUCTNAME version</paragraph>
|
|
</listitem>
|
|
<listitem>
|
|
<paragraph id="par_id671600788076855" role="listitem" xml-lang="en-US">The current user name</paragraph>
|
|
</listitem>
|
|
</list>
|
|
</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>
|
|
<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>
|
|
</bascode>
|
|
<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>
|
|
<bookmark_value>Platform service;CPUCount</bookmark_value>
|
|
<bookmark_value>Platform service;CurrentUser</bookmark_value>
|
|
<bookmark_value>Platform service;Machine</bookmark_value>
|
|
<bookmark_value>Platform service;OfficeVersion</bookmark_value>
|
|
<bookmark_value>Platform service;OSName</bookmark_value>
|
|
<bookmark_value>Platform service;OSPlatform</bookmark_value>
|
|
<bookmark_value>Platform service;OSRelease</bookmark_value>
|
|
<bookmark_value>Platform service;OSVersion</bookmark_value>
|
|
<bookmark_value>Platform service;Processor</bookmark_value>
|
|
</bookmark>
|
|
<h2 id="hd_id711600788076834" xml-lang="en-US">Properties</h2>
|
|
<table id="tab_id701600788076583">
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id461600788076917" role="tablehead" xml-lang="en-US">Name</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id221600788076591" role="tablehead" xml-lang="en-US">Readonly</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id761600788076328" role="tablehead" xml-lang="en-US">Type</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id67160078807636" role="tablehead" xml-lang="en-US">Description</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id491600788076621" role="tablecontent" xml-lang="en-US" localize="false">Architecture</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id311600788076756" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id831600788076785" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id441600788076826" role="tablecontent" xml-lang="en-US">The hardware bit architecture. Example: '<literal>32bit</literal>' or '<literal>64bit</literal>'</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id941600788076595" role="tablecontent" xml-lang="en-US" localize="false">ComputerName</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id49160078807654" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id961600788076376" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id81600788076419" role="tablecontent" xml-lang="en-US">The computer's network name.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id721600788076638" role="tablecontent" xml-lang="en-US" localize="false">CPUCount</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id711600788076534" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id911600788076842" role="tablecontent" xml-lang="en-US" localize="false">Integer</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id541600788076645" role="tablecontent" xml-lang="en-US">The number of central processing units.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id961600788076890" role="tablecontent" xml-lang="en-US" localize="false">CurrentUser</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id891600788076190" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id761600788076562" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id91600788076674" role="tablecontent" xml-lang="en-US">The name of the currently logged user.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id951600788076443" role="tablecontent" xml-lang="en-US" localize="false">Machine</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id391600788076253" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id381600788076799" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id21600788076541" role="tablecontent" xml-lang="en-US">The machine type. Examples are: '<literal>i386</literal>' or '<literal>x86_64</literal>'.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id41600788076936" role="tablecontent" xml-lang="en-US" localize="false">OfficeVersion</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id211600788076138" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id221600788076518" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id521600788076371" role="tablecontent" xml-lang="en-US">The actual %PRODUCTNAME version expressed as<br />' <literal>%PRODUCTNAME w.x.y.z (The Document Foundation)</literal>'.</paragraph>
|
|
<paragraph role="paragraph" id="par_id621614902220807">Example: '<literal>LibreOffice 7.1.1.2 (The Document Foundation, Debian and Ubuntu)</literal>'</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id161600788076362" role="tablecontent" xml-lang="en-US" localize="false">OSName</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id21600788076758" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id871600788076196" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id781600788076694" role="tablecontent" xml-lang="en-US">The operating system type. Example: '<literal>Darwin</literal>, <literal>Linux</literal>' or '<literal>Windows</literal>'.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id471600788076885" role="tablecontent" xml-lang="en-US" localize="false">OSPlatform</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id261600788076841" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id661600788076636" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id11600788076757" role="tablecontent" xml-lang="en-US">A single string identifying the underlying platform with as much useful and human-readable information as possible.</paragraph>
|
|
<paragraph role="paragraph" id="par_id501614902381381">Example: '<literal>Linux-5.8.0-44-generic-x86_64-with-glibc2.32</literal>'</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id221600789141781" role="tablecontent" xml-lang="en-US" localize="false">OSRelease</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id531600789141795" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id561600789141282" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id301600789141619" role="tablecontent" xml-lang="en-US">The operating system's release. Example: '<literal>5.8.0-44-generic</literal>'</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id821600789286339" role="tablecontent" xml-lang="en-US" localize="false">OSVersion</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id541600789286532" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id181600789286889" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id701600789286280" role="tablecontent" xml-lang="en-US">The operating system's build or version.</paragraph>
|
|
<paragraph role="paragraph" id="par_id351614902520555">Example: '<literal>#50-Ubuntu SMP Tue Feb 9 06:29:41 UTC 2021</literal>'</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell>
|
|
<paragraph id="par_id31600789527717" role="tablecontent" xml-lang="en-US" localize="false">Processor</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id941600789527698" role="tablecontent" xml-lang="en-US">Yes</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id100160078952791" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
|
|
</tablecell>
|
|
<tablecell>
|
|
<paragraph id="par_id631600789527859" role="tablecontent" xml-lang="en-US">The real processor name. Example: '<literal>amdk6</literal>'.</paragraph>
|
|
<paragraph role="paragraph" id="par_id111614902598396">This property may return the same value as the <literal>Machine</literal> property.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
</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>
|
|
</section>
|
|
</body>
|
|
</helpdocument> |