diff options
Diffstat (limited to 'helpcontent2/source/text/sbasic/shared/enum.xhp')
-rw-r--r-- | helpcontent2/source/text/sbasic/shared/enum.xhp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/shared/enum.xhp b/helpcontent2/source/text/sbasic/shared/enum.xhp new file mode 100644 index 000000000..5781585ae --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/enum.xhp @@ -0,0 +1,70 @@ +<?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="org.LibreOffice.Help.Enum"> + <title id="tit" xml-lang="en-US">Enum Statement</title> + <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="image" id="par_id831588865616326"> + <image src="media/helpimg/sbasic/Enum_statement.svg" id="img_id651588865616326"><alt id="alt_id281588865616326">Enum syntax</alt></image> + </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> + <paragraph role="bascode" id="N0018" localize="false">Private Enum _WindowManager</paragraph> + <paragraph role="bascode" id="N0019" localize="false"> W1ND0WS = 1 ' Windows</paragraph> + <paragraph role="bascode" id="N0020" localize="false"> OS2PM = 2 ' OS/2 Presentation Manager</paragraph> + <paragraph role="bascode" id="N0021" localize="false"> MACINTOSH = 3 ' Macintosh</paragraph> + <paragraph role="bascode" id="N0022" localize="false"> MOTIF = 4 ' Motif Window Manager / Unix-like</paragraph> + <paragraph role="bascode" id="N0023" localize="false"> OPENLOOK = 5 ' Open Look / Unix-like</paragraph> + <paragraph role="bascode" id="N0024" localize="false">End Enum</paragraph> + <paragraph role="bascode" id="N0027" localize="false">Public Function WindowManager() As Object</paragraph> + <paragraph role="bascode" id="N0028" localize="false"> WindowManager = _WindowManager</paragraph> + <paragraph role="bascode" id="N0029" localize="false">End Function ' <library>.<module>.WindowManager.XXX</paragraph> + </bascode> + <note id="N0030">Enumerated values are rendered to <emph>Long</emph> datatype. Basic functions are public accessors to enumerations. Enumeration names and value names must be unique within a library and across modules.</note> + + <h2 id="N0036">Usage:</h2> + <paragraph role="paragraph" id="N0037">Display WindowManager grouped constant values:</paragraph> + <bascode> + <paragraph role="bascode" id="N0038" localize="false">Dim winMgr As Object : winMgr = <library>.<module>.WindowManager</paragraph> + <paragraph role="bascode" id="N0039" localize="false">With winMgr</paragraph> + <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> + <paragraph role="paragraph" id="N0061"><link href="text/sbasic/shared/03090411.xhp" name="With">With</link> statement</paragraph> + </section> +</body> +</helpdocument> |