summaryrefslogtreecommitdiffstats
path: root/source/text/sbasic/shared/03090413.xhp
blob: 05bb3f292c500a589c1a893925c8e3a0a75a2060 (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
<?xml version="1.0" encoding="UTF-8"?>

<!--
 * 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 .
 -->

 <helpdocument version="1.0">
     <meta>
         <topic id="textsbasicshared03090413xml" indexer="include" status="PUBLISH">
             <title id="tit" xml-lang="en-US">Type Statement</title>
             <filename>/text/sbasic/shared/03090413.xhp</filename>
         </topic>
     </meta>
     <body>
     <section id="type">
         <bookmark xml-lang="en-US" branch="index" id="bm_id3153311">
             <bookmark_value>Type statement</bookmark_value>
         </bookmark>
         <paragraph role="heading" id="hd_id3153311" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03090413.xhp" name="Type Statement">Type Statement</link></paragraph>
         <paragraph role="paragraph" id="par_id3159158" xml-lang="en-US">Define non-UNO data structures (structs).</paragraph>
     </section>
     <paragraph role="paragraph" id="par_id311512206747401" xml-lang="en-US">A struct is an ordered collection of data fields, that can be manipulated as a single item.</paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
     <bascode>
         <paragraph role="bascode" id="par_id3145609" xml-lang="en-US" localize="false">Type StructName</paragraph>
         <paragraph role="bascode" id="par_id951512205849777" xml-lang="en-US" localize="false"> DataField1 As TypeName1</paragraph>
         <paragraph role="bascode" id="par_id951512205849778" xml-lang="en-US" localize="false"> DataField2 As TypeName2</paragraph>
         <paragraph role="bascode" id="par_id951512205849779" xml-lang="en-US" localize="false"> (...)</paragraph>
         <paragraph role="bascode" id="par_id841512205903256" xml-lang="en-US" localize="false">End Type</paragraph>
     </bascode>
     <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
     <bascode>
         <paragraph role="bascode" id="par_id761512211077225" xml-lang="en-US" localize="false">REM  *****  BASIC  *****</paragraph>
         <paragraph role="bascode" id="par_id981512211072701" xml-lang="en-US" localize="false">Type customer</paragraph>
         <paragraph role="bascode" id="par_id171512211067797" xml-lang="en-US" localize="false"> Name1 As String</paragraph>
         <paragraph role="bascode" id="par_id541512211063461" xml-lang="en-US" localize="false"> City As String</paragraph>
         <paragraph role="bascode" id="par_id481512211058930" xml-lang="en-US" localize="false">End Type</paragraph>
         <paragraph role="bascode" id="par_id841512211054689" xml-lang="en-US" localize="false">Sub setCustomer</paragraph>
         <paragraph role="bascode" id="par_id471512211049777" xml-lang="en-US" localize="false"> Dim oCustomer as new customer</paragraph>
         <paragraph role="bascode" id="par_id881512211042456" xml-lang="en-US" localize="false"> oCustomer.Name1 = "The Document Foundation"</paragraph>
         <paragraph role="bascode" id="par_id461512211038180" xml-lang="en-US" localize="false"> oCustomer.City = "Berlin"</paragraph>
         <paragraph role="bascode" id="par_id21512211032617" xml-lang="en-US" localize="false">End Sub</paragraph>
     </bascode>
     <section id="relatedtopics">
         <paragraph role="paragraph" id="par_id211512215755793" xml-lang="en-US"><link href="text/sbasic/shared/03132400.xhp" name="CreateObject function">CreateObject function</link></paragraph>
     </section>
 </body>
</helpdocument>