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

RE: masked textbox to numeric

$
0
0

Is this a maskedtextbox control?

If it is then you can set the property TextMaskFormat = ExcludePromptAndLiterals and then the value of the Text property will be stripped of the mask characters and the move should work.

You might want to use TryParse instead if you wish to validate that the field contains valid characters.

      01 field     pic 9(10).
      01 numfield  decimal.
      01 mystring  string.

          set mystring to maskedtextbox1::Text
          if type Decimal::TryParse(mystring, numfield)
             move numfield to field
          else
            invoke type MessageBox::Show("Error not numeric")
          end-if


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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