home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / CALC / HEX.PRG < prev   
Encoding:
Text File  |  1992-07-12  |  819 b   |  22 lines

  1. *****************************************************************
  2. *     * 07/12/92              CALC.PRG                 06:19:39 *
  3. *****************************************************************
  4. *     * Author's Name: Jeb Long                                 *
  5. *     *                                                         *
  6. *     * Description:                                            *
  7. *     * This converts hex string to number                      *
  8. *     *                                                         *
  9. *****************************************************************
  10. PARAMETER string
  11. private number, s, c 
  12. number=0
  13. s = upper(string)
  14. FOR K = 1 TO 5
  15.   c = SUBSTR(s,k,1)
  16.   if c=' '
  17.     return
  18.   endif
  19. number = (16*number) + (AT(c,'0123456789ABCDEF')-1)
  20. ENDFOR
  21. RETURN number
  22.