home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST92.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  867 b   |  38 lines

  1. *******************
  2.  
  3. FUNCTION Decihexi
  4.  
  5.    PARAMETERS _thenum
  6.  
  7.    IF EMPTY(PCOUNT())
  8.       RETURN("")
  9.    ENDIF
  10.    IF !(TYPE("_thenum") $ "CN")
  11.       RETURN("")    && For the Larry J's of the world. Argh!!!
  12.    ELSE
  13.       IF TYPE("_thenum") = "N"
  14.          _thenum = LTRIM(STR(_thenum))
  15.       ENDIF
  16.    ENDIF
  17.  
  18.    PRIVATE _final, _steve
  19.  
  20.    _final = IF( !EMPTY(_thenum), INT(VAL(_thenum)), 0)
  21.    _steve = ""                                                    && So I do have an ego, at least I've got version numbers
  22.    DO WHILE _final >= 16
  23.       _steve = DECIVERT( INT( _final % 16) ) + _steve
  24.       _final = _final / 16
  25.    ENDDO
  26.    RETURN( DECIVERT( INT( _final) ) + _steve )
  27.  
  28. *******************
  29.  
  30. FUNCTION Decivert
  31.  
  32.    PARAMETER _hexval
  33.  
  34.    RETURN(IF( EMPTY(_hexval), "0", SUBSTR("123456789ABCDEF", _hexval, 1)))
  35.  
  36. * End of File
  37.  
  38.