para convertir un numero de decimal a hexadecimal en foxpro 9:
Autor:Jose raul romero(pollo)
esto lo pondras en un botton:
WITH thisform
n=VAL(.t1.value)
m=0
c=0
IF n=16
.t2.value="10"
n=0
ENDIF
DO WHILE n>0
c=INT(n/16)
IF n>16
m=MOD(n,16)
ELSE
m=n
ENDIF
IF m>=10
IF m=10
.t2.value="A"+ALLTRIM(.t2.value)
ELSE
IF m=11
.t2.value="B"+ ALLTRIM(.t2.value)
ELSE
IF m=12
.t2.value="C"+ALLTRIM(.t2.value)
ELSE
IF m=13
.t2.value="D"+ALLTRIM(.t2.value)
ELSE
IF m=14
.t2.value="E"+ALLTRIM(.t2.value)
ELSE
IF m=15
.t2.value="F"+ALLTRIM(.t2.value)
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ELSE
.t2.value=STR(m)+ALLTRIM(.t2.value)
IF n<16
n=0
c=0
ENDIF
ENDIF
n=c
ENDDO
ENDWITH
Autor: Jose raul romero (pollo)
Comentarios
Publicar un comentario