ToObject( ) method
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Return type: Progress.Lang.Enum
Access: PUBLIC STATIC FINAL
Applies to: Progress.Lang.Enum class
Syntax
|
- enum-type-name
- The name of an enum type.
- enum-member-name
- The name of an enum member of the specified enum type. For a flag enum type, this can be a comma-delimited list of enum members.
- value
- The underlying numeric value of an enum member of the specified enum type. For a flag enum type, this value can represent two or more enum members.
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:
|
|
Notes
- Because
ToObject( )returns a weakly typed instance, you must use CAST, as shown in the example above, if you want to assign the method's return value to a variable defined as a specific enum type. To create a strongly typed enum instance, use theGetEnum( )method.