TAA Tools
CVTHEXDEC       CONVERT HEX TO DECIMAL                 TAAHEXB

The  Convert Hex  to Decimal  command  converts an  8  byte value  that
contains hex characters to the decimal equivalent.

For  example, if  you  have the  hex  representation of  an  address or
offset  as  hex '00000103',  CVTHEXDEC can  be used  to convert  to the
decimal equivalent of 259.

The typical use in a CL program would be:

           DCL        &HEX *CHAR LEN(8)
           DCL        &DEC *DEC LEN(9 0)
            .
            .         /* Some method of placing the hex   */
            .         /*   value in the variable &HEX     */
            .         /*   such as CHGVAR &HEX '00000103' */
            .
           CVTHEXDEC  HEX(&HEX) DEC(&DEC)

You can also  call the CPP  (an RPG program)  directly.  The  following
RPG specifications are  in the correct format to be  copied into an RPG
program.

     C                     MOVE '00000103'HEX     8
     C                     CALL 'TAAHEXBR'
     C                     PARM           HEX
     C                     PARM           DEC     90

The  values passed must be valid hex  characters (0-F) and must convert
to a 9 digit value.  Negative values are valid.

Command parameters                                    *CMD
------------------

   HEX           The 8 byte  value containing  hex characters (0-F)  to
                 be converted.   It must  be declared as  *CHAR LEN(8).

   DEC           The  9 digit decimal  value to  be returned.   It must
                 be declared as *DEC LEN(9 0).

Restrictions
------------

Because the command returns  a variable, it  can only be  used in a  CL
program.

Prerequisites
-------------

The following TAA Tools must be on your system:

     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   CVTHEXDEC     *CMD                   TAAHEXB       QATTCMD
   TAAHEXBR      *PGM       RPG         TAAHEXBR      QATTRPG
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top