From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- helpcontent2/source/text/sbasic/shared/enum.xhp | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/enum.xhp (limited to 'helpcontent2/source/text/sbasic/shared/enum.xhp') 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 @@ + + + + + + Enum Statement + /text/sbasic/shared/enum.xhp + + + + + Enum statement + constant groups + enumerations + +
+

Enum Statement [VBA]

+ Define enumerations or non UNO constant groups. An enumeration is a value list that facilitates programming and eases code logic review. +
+ + + + Enum syntax + + + Enum list_name
+ ' Object Statement block + End Enum ' list_name +
+

Parameters:

+ Within a given enumeration, fit together values that logically relate to one another. + + + Option VBASupport 1
+ Private Enum _WindowManager + W1ND0WS = 1 ' Windows + OS2PM = 2 ' OS/2 Presentation Manager + MACINTOSH = 3 ' Macintosh + MOTIF = 4 ' Motif Window Manager / Unix-like + OPENLOOK = 5 ' Open Look / Unix-like + End Enum + Public Function WindowManager() As Object + WindowManager = _WindowManager + End Function ' <library>.<module>.WindowManager.XXX +
+ Enumerated values are rendered to Long datatype. Basic functions are public accessors to enumerations. Enumeration names and value names must be unique within a library and across modules. + +

Usage:

+ Display WindowManager grouped constant values: + + Dim winMgr As Object : winMgr = <library>.<module>.WindowManager + With winMgr + Print .MACINTOSH, .MOTIF, .OPENLOOK, .OS2PM, .W1ND0WS + End With + + Enumerations can be extended to other data types using Type statement definitions. Calling Python Scripts from Basic illustrates that mechanism. +
+ Const statement, constants + Option VBASupport statement + With statement +
+ +
-- cgit v1.2.3