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

RE: exposing .Net classes

$
0
0

Actually, the repository is no longer required in Visual COBOL. That is a holdover from Net Express.

In VC you use the type keyword to specify a class name.

You should be able to use:

   set myDecimal to type Convert::ToDecimal(mystring)

without specifying $set ilusing"System" because the System namespace is automatically included by default.

If you wish to do validation then you could instead use the TryParse method of the Decimal class.

  if not type Decimal::TryParse(mystring, myDecimal)

      move 0 to myDecimal

  end-if

Or you could insert a try catch block around the Convert statement.

Thanks.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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