forked from amazingfate/help
Replacement done with
find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'
(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)
translation files will be prepped with:
find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
$'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'
(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)
Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
71 lines
4.9 KiB
XML
71 lines
4.9 KiB
XML
<?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">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">Type statement</link> definitions. <link href="text/sbasic/guide/basic_2_python.xhp">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">Const</link> statement, <link href="text/sbasic/shared/01020100.xhp">constants</link></paragraph>
|
|
<paragraph role="paragraph" id="N0053"><link href="text/sbasic/shared/03103350.xhp">Option VBASupport</link> statement</paragraph>
|
|
<paragraph role="paragraph" id="N0061"><link href="text/sbasic/shared/03090411.xhp">With</link> statement</paragraph>
|
|
</section>
|
|
</body>
|
|
</helpdocument>
|