DTRHELP.HLB  —  New Features, UNSIGNED Field Attribute
       DEC DATATRIEVE Version 7.1 supports a new field attribute:
       UNSIGNED. The UNSIGNED field attribute is valid for fields
       of format: BYTE, LONG, WORD, and QUADWORD. The UNSIGNED field
       attribute allows you to extend the range of the specified field
       values because it considers only the positive values.

       In the following example F1 is declared as a LONG therefore
       its range is from -2**31 to +2**31 - 1. F2 is decleare as LONG
       UNSIGNED, having a double range of positive values.

       DTR> DECLARE F1 LONG .
       DTR> F1 = 3000000000
       Variable "F1" may contain an incorrect value due to error during assignment.
       Truncation during assignment.
       DTR> DECLARE F2 LONG UNSIGNED .
       DTR> F2 = 3000000000
       DTR>

       DEC DATATRIEVE V7.1 manages
       unsigned quadword fields and variables as signed quadwords.

       DTR> DECLARE RECORD R
       DFN> 01 R.
       DFN> 05 LL2.
       DFN> 10 L0 LONG.
       DFN> 10 L1 LONG.
       DFN> 05 ULL2 REDEFINES LL2.
       DFN> 10 L2 UNSIGNED LONG.
       DFN> 10 L3 UNSIGNED LONG.
       DFN> 05 Q0 REDEFINES LL2 UNSIGNED QUAD .
       DFN> 05 Q1 REDEFINES LL2 QUAD . ;
       [Record is 8 bytes long.]
       DTR>
       DTR> DECLARE DOMAIN D USING R ON UNSIGNED_Q.DAT
       DTR> DEFINE FILE FOR D ;
       DTR> READY D WRITE ;
       DTR> STORE D USING BEGIN L0 = -1 ; L1 = -1 ; END ;
       DTR> PRINT L0, L1, L2, L3 OF D ;
Close Help