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

RE: Using SPZERO in Visual COBOL

$
0
0

Actually, what the documentation says is the following:

Note:

  This directive has been deprecated; it is provided for backward compatibility only.
  You should instead use SIGN-FIXUP.
  This directive can adversely affect the performance of generated code.
  This directive is not supported in .NET COBOL.

So the directive still works for native COBOL projects in Visual COBOL but it is not suppported for managed code .NET applications.
You should look at replacing SPZERO with SIGN-FIXUP if using managed code.

I tested the following in a native project in Visual COBOL 2.1 and without SPZERO it gives the incorrect result and with SPZERO it gives the correct result.

Will you be using native code or managed code when you go to Visual COBOL?

     $set spzero
      program-id. Program1 as "testspzero.Program1".
      data division.
      working-storage section.
      01 num-field    pic s9(9).
      01 char-field   redefines num-field pic x(9).
      procedure division.
          move spaces to char-field
          subtract 1 from num-field
          display num-field
          goback.
      end program Program1.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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