• 1 reply
  • Latest Post - ‏2013-04-26T14:57:49Z by markevans
16 Posts

Pinned topic avoid error with redefined field as num

‏2013-04-26T10:03:30Z |



How can i avoid error with redefinitions when the "father" has a value of empty string

Some like this

10 CLAVE char(10) ;

20 CLAVEN num(10) ;


if i assign one value of "" to CLAVE, i would like to make the CLAVEN to get a value of ZERO


I tryed with the property blanksaszero but doesnt seems to help much

thanks in advance



  • markevans
    2921 Posts

    Re: avoid error with redefined field as num



    In your example, you have a  "substructured field" which means the NUM field redefines the same area of storage as its parent.   Since they overlay the same area of storage, they cannot have two different values.   So when you assign a blank to CLAVE...the CLAVEN field will have invalid values as you discovered.

    There also is a build descriptor named SpacesZero which will allow the Num field to be treated as zero even though it holds the blank value.  See the helps on when that occurs.   Also note that this is implemented by creating and populating temporary fields whenever the NUM field is used (comparison, assignment, etc)...  so there is some performance overhead.