Return type: Progress.Lang.Enum
Access: PUBLIC STATIC FINAL
Applies to: Progress.Lang.Enum class
ToObject ( INPUT enum-type-name AS CHARACTER, INPUT enum-member-name AS CHARACTER ) ToObject ( INPUT enum-type-name AS CHARACTER, INPUT value AS INT64 ) |
The method returns an error if a member name or numeric value does not correspond to a member of the enum type. The exception to this is that you can pass a value of 0 for a flag enum type even if no member has been explicitly defined for 0.
This code excerpt creates an instance of the user-defined Permission flag enum and assigns vPerm the members Write and Create. Both versions of the final statement have the same result:
ENUM Permission FLAGS: DEFINE ENUM None = 0 Read = 0x01 Write = 0x02 ReadWrite = 0x03 Create = 0x04 Delete = 0x08. END ENUM. |
USING Progress.Lang.*. DEFINE VARIABLE vPerm AS Permission. vPerm = CAST(Enum:ToObject(Permission, "Write,Create"), Permission). vPerm = CAST(Enum:ToObject(Permission, 0x06), Permission). |