summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/shared/03040000.xhp
blob: 0bcdb47e925cc1ed7313863f1e7ec59286b02905 (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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<?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/.
    *
    * This file incorporates work covered by the following license notice:
    *
    *   Licensed to the Apache Software Foundation (ASF) under one or more
    *   contributor license agreements. See the NOTICE file distributed
    *   with this work for additional information regarding copyright
    *   ownership. The ASF licenses this file to you under the Apache
    *   License, Version 2.0 (the "License"); you may not use this file
    *   except in compliance with the License. You may obtain a copy of
    *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
    -->

    <meta>
        <topic id="textsbasicshared03040000xml">
            <title id="tit" xml-lang="en-US">Basic Constants</title>
            <filename>/text/sbasic/shared/03040000.xhp</filename>
        </topic>
    </meta>

    <body>
    <section id="basic_constants">
        <bookmark xml-lang="en-US" branch="index" id="bm_id051720170831387233">
<bookmark_value>Basic constants</bookmark_value>
        </bookmark>
        <paragraph id="hd_id051620171022255424" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03040000.xhp">Basic Constants</link></paragraph>
        <paragraph id="par_id051620171022384640" role="paragraph" xml-lang="en-US"><ahelp hid=".">Constants used in Basic programs</ahelp></paragraph>
    </section>

    <section id="booleanconstants">
        <bookmark xml-lang="en-US" branch="index" id="bm_id871554200620243">
<bookmark_value>Boolean Basic constants</bookmark_value>
<bookmark_value>Basic constant;False</bookmark_value>
<bookmark_value>Basic constant;True</bookmark_value>
        </bookmark>
        <h2 id="par_id051620171022382581">Boolean constants</h2>

        <table id="tbl_051620171030174631">
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114565335" role="tablehead" xml-lang="en-US">Name</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114565484" role="tablehead" xml-lang="en-US">Type</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114563271" role="tablehead" xml-lang="en-US">Value</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114567378" role="paragraph" localize="false" xml-lang="en-US">True</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114563299" role="paragraph" localize="false" xml-lang="en-US">Boolean</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114565603" role="paragraph" localize="false" xml-lang="en-US">1</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114564178" role="paragraph" localize="false" xml-lang="en-US">False</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114566455" role="paragraph" localize="false" xml-lang="en-US">Boolean</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114563986" role="paragraph" localize="false" xml-lang="en-US">0</paragraph>
                </tablecell>
            </tablerow>
        </table>

        <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
        <bascode>
            <paragraph id="par_id051620171114567539" role="bascode" localize="false">Dim bPositive as Boolean</paragraph>
            <paragraph id="par_id051620171114574976" role="bascode" localize="false">bPositive = True</paragraph>
        </bascode>
    </section>

    <section id="mathconstants">
        <bookmark xml-lang="en-US" branch="index" id="bm_id131554200364170">
<bookmark_value>Basic Mathematical constants</bookmark_value>
<bookmark_value>Pi;Basic constant</bookmark_value>
<bookmark_value>Basic constant;Pi</bookmark_value>
        </bookmark>

        <h2 id="hd_id051620171114573549">Mathematical constant</h2>

        <table id="tbl_051620171031298215">
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114576150" role="tablehead" xml-lang="en-US">Name</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114575122" role="tablehead" xml-lang="en-US">Type</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114574987" role="tablehead" xml-lang="en-US">Value</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114574028" role="paragraph" localize="false">Pi</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114571506" role="paragraph" localize="false">Double</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114576361" role="paragraph" localize="false">3.14159265358979</paragraph>
                </tablecell>
            </tablerow>
        </table>

        <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
        <bascode>
            <paragraph id="par_id051620171114575849" role="bascode" localize="false">Function Rad2Deg( aRad as Double) As Double</paragraph>
            <paragraph id="par_id051620171114575132" role="bascode" localize="false"> Rad2Deg = aRad * 180.00 / Pi</paragraph>
            <paragraph id="par_id051620171114571381" role="bascode" localize="false">End Function</paragraph>
        </bascode>
    </section>

    <section id="objectconstants">
        <bookmark xml-lang="en-US" branch="index" id="bm_id261554201061695">
<bookmark_value>Basic Object constants</bookmark_value>
<bookmark_value>Empty;Basic constant</bookmark_value>
<bookmark_value>Null;Basic constant</bookmark_value>
<bookmark_value>Nothing;Basic constant</bookmark_value>
<bookmark_value>Basic constant;Nothing</bookmark_value>
<bookmark_value>Basic constant;Null</bookmark_value>
<bookmark_value>Basic constant;Empty</bookmark_value>
        </bookmark>

        <h2 id="hd_id051620171114576454">Object Constants</h2>

        <table id="tbl_051620171033491648">
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114576921" role="tablehead" xml-lang="en-US">Name</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114578188" role="tablehead" xml-lang="en-US">Type</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051720170824099845" role="tablehead" xml-lang="en-US">Usage</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114575052" role="paragraph" localize="false">Empty</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114576734" role="paragraph" localize="false">Variant</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id05172017082409622" role="paragraph" xml-lang="en-US">The <emph>Empty</emph> value indicates that the variable is not initialized.</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051620171114577892" role="paragraph" localize="false">Null</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051620171114571232" role="paragraph" localize="false">null</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051720170824093395" role="paragraph" xml-lang="en-US">Indicates that the variable does not contain data.</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id051720170824091253" role="paragraph" localize="false">Nothing</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051720170824091966" role="paragraph" localize="false">Object</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id051720170824097935" role="paragraph" xml-lang="en-US">Assign the <emph>Nothing</emph> object to a variable to remove a previous assignment.</paragraph>
                </tablecell>
            </tablerow>
        </table>

        <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
        <bascode>
            <paragraph id="par_id051620171114575772" role="bascode" localize="false">SubExampleEmpty</paragraph>
            <paragraph id="par_id051620171114572075" role="bascode" localize="false">Dim sVar As Variant</paragraph>
            <paragraph id="par_id051620171114579662" role="bascode" localize="false"> sVar = Empty</paragraph>
            <paragraph id="par_id051620171114577052" role="bascode" localize="false"> Print IsEmpty(sVar) ' Returns True</paragraph>
            <paragraph id="par_id051620171114576576" role="bascode" localize="false">End Sub</paragraph>
            <paragraph id="par_id051620171114573781" role="bascode" localize="false">Sub ExampleNull</paragraph>
            <paragraph id="par_id051620171114584136" role="bascode" localize="false">Dim vVar As Variant</paragraph>
            <paragraph id="par_id05162017111458231" role="bascode" localize="false" > MsgBox IsNull(vVar)</paragraph>
            <paragraph id="par_id051620171114581488" role="bascode" localize="false">End Sub</paragraph>
            <paragraph id="par_id051720170824102912" role="bascode" localize="false">Sub ExampleNothing</paragraph>
            <paragraph id="par_id051720170824104202" role="bascode" localize="false">Dim oDoc As Object</paragraph>
            <paragraph id="par_id051720170824102971" role="bascode" localize="false"> Set oDoc = ThisComponent</paragraph>
            <paragraph id="par_id051720170824104997" role="bascode" localize="false"> Print oDoc.Title</paragraph>
            <paragraph id="par_id051720170824104443" role="bascode" localize="false"> oDoc = Nothing</paragraph>
            <paragraph id="par_id051720170824106132" role="bascode" localize="false"> Print oDoc ‘ Error</paragraph>
            <paragraph id="par_id051720170824103527" role="bascode" localize="false">End Sub</paragraph>
        </bascode>
    </section>
    <section id="addvbaconstants">
        <bookmark xml-lang="en-US" branch="index" id="bm_id101554201127393">
<bookmark_value>Visual Basic constants</bookmark_value>
<bookmark_value>VBA Exclusive constants</bookmark_value>
        </bookmark>
        <h2 id="hd_id661512312593832">Additional VBA constants</h2>
        <paragraph role="paragraph" id="par_id111512312705893" xml-lang="en-US">The following constants are available when VBA compatibility mode is enabled</paragraph>

        <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/>
        <table id="tab_id671512313939217">
            <tablerow>
                <tablecell>
                    <paragraph role="tablehead" id="par_id901512312880723" xml-lang="en-US">Named constant</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id891512312916493" role="tablehead" xml-lang="en-US">Hexadecimal (decimal) value</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id991512312965968" role="tablehead" xml-lang="en-US" >Description</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id311542196872466" role="paragraph" localize="false">vbTrue</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id151542196872467" role="paragraph" localize="false">-1</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph role="paragraph" id="par_id671542197262160" xml-lang="en-US">Part of vbTriState enumeration.</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id241542196923343" role="paragraph" localize="false">vbFalse</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id611542196923343" role="paragraph" localize="false">0</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph role="paragraph" id="par_id351542197255532" xml-lang="en-US">Part of vbTriState enumeration.</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id551542196949698" role="paragraph" localize="false">vbUseDefault</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id831542196949698" role="paragraph" localize="false">-2</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph role="paragraph" id="par_id251542197274514" xml-lang="en-US">Part of vbTriState enumeration.</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id891512313266496" role="paragraph" localize="false">vbCr</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph role="paragraph" id="par_id241512313723033" localize="false">\x0D (13)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph role="paragraph" id="par_id611512313731233" xml-lang="en-US">CR - Carriage return</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id471512313282257" role="paragraph" localize="false">vbCrLf</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id691512313750520" role="paragraph" localize="false">\x0D\x0A (13 10)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id961512313881937" role="paragraph" xml-lang="en-US" >CRLF - Carriage return and line feed</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id11512313289164" role="paragraph" localize="false">vbFormFeed</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id341512313761295" role="paragraph" localize="false">\x0c (12)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id221512313889077" role="paragraph" xml-lang="en-US" >FF - Form feed</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id501512313293989" role="paragraph" localize="false">vbLf</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id311512313777558" role="paragraph" localize="false">\x0A (10)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id621512313896169" role="paragraph" xml-lang="en-US" >LF - Line feed</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id191512313300610" role="paragraph" localize="false">vbNewLine</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id521512319135830"  role="listitem" xml-lang="en-US">\x0D\x0A (13 10) for Windows</paragraph>
                    <paragraph id="par_id61512319163913"  role="listitem" xml-lang="en-US">\x0A (10) for other systems</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id151512313904989" role="paragraph" xml-lang="en-US" >LF or CRLF </paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id211512313306932" role="paragraph" xml-lang="en-US" localize="false">vbNullString</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id141512313800110" role="paragraph" localize="false">""</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id741512313911049" role="paragraph" xml-lang="en-US" >Null string</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id931512313312621" role="paragraph" localize="false">vbTab</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id241512313810064" role="paragraph" localize="false">\x09 (9)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id951512313918356" role="paragraph" xml-lang="en-US" >HT - Horizontal tab</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id481512313318983" role="paragraph" localize="false">vbVerticalTab </paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id991512313821414" role="paragraph" localize="false">\x0B (11)</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id351512313924593" role="paragraph" xml-lang="en-US" >VT - Vertical tab</paragraph>
                </tablecell>
            </tablerow>
        </table>
    </section>
</body>
</helpdocument>