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

RE: Example of Enumeration

$
0
0

The following appears to work for the simple example where you want to validate if a string exists within a specified e-num and then to return true or false for this.

The second parameter "true" specifies that the search should be case insensitive.

The actual value of the enum found will be returned in DomainExt or the default value if the string is not found.

      method-id ValidateDomain.
      01 domainExt type DomainExtensions.
      procedure division using by value domainString as String
                  returning validDomain as type Boolean.

           set validDomain to type Enum::TryParse(domainString, true, domainExt)

      end method            


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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