HP 3000 Manuals

HPPACCVAD [ Compiler Library/XL Reference Manual ] MPE/iX 5.0 Documentation


Compiler Library/XL Reference Manual

HPPACCVAD 

HPPACCVAD performs an ASCII-to-decimal conversion.

Declaration 

     PROCEDURE HPPACCVAD (
               ANYVAR target          : decimal_type;
                      targetdigs      : INTEGER;
               ANYVAR source          : ascii_type;
                      sourcedigs      : INTEGER;
               VAR    comparison_code : INTEGER;
               VAR    pacstatus       : INTEGER)
        OPTION
               DEFAULT_PARMS (
                      comparison_code := NIL,
                      pacstatus       := NIL)
               UNCHECKABLE_ANYVAR;
        EXTERNAL;

Comments 

 *  Source digits in external-decimal are converted to packed-decimal
    digits.  Source digits, except for the rightmost in the field, must
    be leading blanks or unsigned digits.  The rightmost digit indicates
    the sign.

 *  Leading blanks are converted to packed-decimal zeros.

 *  Blanks between digits are illegal.

 *  An all-blank field converts to an unsigned zero target field.

 *  An unsigned external-decimal operand produces an unsigned
    packed-decimal result.

 *  If the number of target digits is less than the number of source
    digits, the source is converted until the target is filled, producing
    a left-truncated result.  In this case, the remaining source digits
    are not examined for validity.

 *  If the source digit count is less than the target digit count, left
    zero fill is placed in the target field.

 *  If either the source or target digit count is zero, no conversion is
    performed.

Possible Traps 

Invalid ASCII digit (2)
Invalid decimal operand length (5)



MPE/iX 5.0 Documentation