diff options
author | LibreOfficiant <LibreOfficiant@sfr.fr> | 2019-11-13 11:16:11 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2019-11-22 15:31:29 +0100 |
commit | efc72a00693af420979735313b57eced9ac0fbaa (patch) | |
tree | 85b9acdd47606269f8e06c9c61ff37d14f7f3a06 /source/text | |
parent | eee359bf03c95f84536f4bba3e340e366fe236f9 (diff) |
LibO Type statement extends enumerations to all data types.
Change-Id: I8574a5c9290071c96618b1cb1aadc26068abd2b1
Reviewed-on: https://gerrit.libreoffice.org/82571
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
(cherry picked from commit 2647b00f50bee666a7e23bb5f8471269d03b41c9)
Reviewed-on: https://gerrit.libreoffice.org/83494
Diffstat (limited to 'source/text')
-rw-r--r-- | source/text/sbasic/shared/03090413.xhp | 31 | ||||
-rw-r--r-- | source/text/sbasic/shared/enum.xhp | 13 |
2 files changed, 22 insertions, 22 deletions
diff --git a/source/text/sbasic/shared/03090413.xhp b/source/text/sbasic/shared/03090413.xhp index 05bb3f292c..2956f7e8f6 100644 --- a/source/text/sbasic/shared/03090413.xhp +++ b/source/text/sbasic/shared/03090413.xhp @@ -31,30 +31,31 @@ <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> + <paragraph role="paragraph" id="par_id3159158" xml-lang="en-US">Define non-UNO data structures.</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> + <paragraph role="paragraph" id="par_id311512206747401" xml-lang="en-US">A Type structure 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> + <paragraph role="bascode" id="par_id3145609" xml-lang="en-US" localize="false">Type struct_name</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 ' struct_name</paragraph> </bascode> + <note id="par_id351573639548645">A Type structure scope is that of the module it belongs to.</note> <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_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 ' Customer structure</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_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> + <tip id="par_id701573639564765"><link href="text/sbasic/shared/enum.xhp" name ="enumerations">Enumerations</link> can be created using Type statement definitions. <link href="text/sbasic/guide/basic_2_python.xhp" name ="Calling Python Scripts from Basic">Calling Python Scripts from Basic</link> illustrates that mechanism.</tip> <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> diff --git a/source/text/sbasic/shared/enum.xhp b/source/text/sbasic/shared/enum.xhp index e56b335d12..8ba2d7901f 100644 --- a/source/text/sbasic/shared/enum.xhp +++ b/source/text/sbasic/shared/enum.xhp @@ -14,26 +14,25 @@ <filename>/text/sbasic/shared/enum.xhp</filename> </topic> </meta> - <body> <bookmark branch="index" xml-lang="en-US" id="N0001"> <bookmark_value>Enum statement</bookmark_value> <bookmark_value>constant groups</bookmark_value> <bookmark_value>enumerations</bookmark_value> </bookmark> - <section id="enumheading"> <h1 id="hd_id221543446540070"><link href="text/sbasic/shared/enum.xhp" name="command_name">Enum Statement [VBA]</link></h1> <paragraph role="paragraph" id="N0003">Define enumerations or non UNO constant groups. An enumeration is a value list that facilitates programming and eases code logic review.</paragraph> </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> - <paragraph role="code" id="par_id931543441922328" localize="false">Enum<br/></paragraph> - <paragraph role="code" id="par_id771543441931669" localize="false"> Object Statement block<br/></paragraph> - <paragraph role="code" id="par_id21543441938004" localize="false">End Enum</paragraph> + <bascode> + <paragraph role="bascode" id="par_id931543441922328" localize="false">Enum list_name<br/></paragraph> + <paragraph role="bascode" id="par_id771543441931669" localize="false"> ' Object Statement block</paragraph> + <paragraph role="bascode" id="par_id21543441938004" localize="false">End Enum ' list_name</paragraph> + </bascode> <h2 id="N0006">Parameters:</h2> <paragraph role="paragraph" id="N0007">Within a given enumeration, fit together values that logically relate to one another.</paragraph> - <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> <paragraph role="bascode" id="N0008" localize="false">Option VBASupport 1<br/></paragraph> @@ -58,7 +57,7 @@ <paragraph role="bascode" id="N0040" localize="false"> Print .MACINTOSH, .MOTIF, .OPENLOOK, .OS2PM, .W1ND0WS</paragraph> <paragraph role="bascode" id="N0041" localize="false">End With</paragraph> </bascode> - + <tip id="par_id731573636687662">Enumerations can be extended to other data types using <link href="text/sbasic/shared/03090413.xhp" name ="Type statement">Type statement</link> definitions. <link href="text/sbasic/guide/basic_2_python.xhp" name ="Calling Python Scripts from Basic">Calling Python Scripts from Basic</link> illustrates that mechanism.</tip> <section id="relatedtopics" > <paragraph role="paragraph" id="N0051"><link href="text/sbasic/shared/03100700.xhp" name="const">Const</link> statement, <link href="text/sbasic/shared/01020100.xhp" name ="external">constants</link></paragraph> <paragraph role="paragraph" id="N0053"><link href="text/sbasic/shared/03103350.xhp" name="Option VBASupport">Option VBASupport</link> statement</paragraph> |