summaryrefslogtreecommitdiffstats
path: root/source/text/sbasic/shared/03/sf_platform.xhp
blob: ef534cc8672bd31e3dcef8d3eb762cbcbc09fe23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?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>
  <embed href="text/sbasic/shared/00000003.xhp#Python_Support"/>
    <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>