Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Example of Enumeration

$
0
0

For the parse, you will need something like:

  set domainExt to type Enum::Parse(type of DomainExtensions, domainString, true)

            as type DomainExtensions

Note that the first parameter is a Type object, which can be returned using the TYPE OF operator.

Also this method returns a simple object, which needs to be cast to the correct enumeration type.

I have a feeling there should be an easier way of converting a string into an enum, but can't think of it right now.

Also it may be worth pointing out that you don't need to instantiate the enum before the call to the Parse method.  Normally you set these things using syntax like:

set domainExt to type DomainExtensions::com


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>