十进制转换为十六进制

作者在 2016-10-10 12:30:46 发布以下内容


?DECTOHEX(31)
?DECTOHEX(ASC([红]))
?DECTOHEX(ASC(SUBS([红],1,1))) + DECTOHEX(ASC(SUBS([红],2,1)))
*--------------------------------------------------------------------------------
*十进制转十六进制函数
*--------------------------------------------------------------------------------
FUNCTION DECTOHEX
PARAMETERS INNUM
CSTR=[] 
DO WHILE INNUM>0
   CSTR=IIF(BETWEEN(MOD(INNUM,16),10,15),CHR(MOD(INNUM,16)+55),TRANSFORM(MOD(INNUM,16)))+CSTR
   INNUM=INT(INNUM/16)
ENDDO
RETURN CSTR


编码转换 | 阅读 3229 次
文章评论,共0条
游客请输入验证码
浏览403480次