PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Hex converter for WD
Hex converter for WD
Iniciado por gill, 23,jun. 2003 09:19 - 2 respuestas
Publicado el 23,junio 2003 - 09:19
Hi
Does anyone have a hex converter / hex-dec/dec-hex procedure that can accept input param and give text result?
Please
Gill
Publicado el 23,junio 2003 - 15:47
Hi
Does anyone have a hex converter / hex-dec/dec-hex procedure that can accept input param and give text result?
Please
Gill

Gill,
I have not written one with WD but the algorithm is easy. From dec to hex you just repeatedly divide by 16 and take the remainder each time (using a mask to convert to single character 0 to F) until the quotient is less than 16. The last quotient is the high order place holder and the remainders go from last to first - high order to low order)
>From hex to dec you reverse this. Split off each character, translate via the mask and then multiply by 16 and add to number.
hth
Clive
Publicado el 23,junio 2003 - 18:13
Hi Gill
Our french FAQ resolved this somes monthes ago...
u can copy french code and use wd code translator.
The aim is use auto vars types resolution from a char to a small interger easy to convert into hexadecimal.
Read there the code : http://rbesset.net/modules/xoopsfaq/index.php…
Sorry for the french but i cannot have a full content translated website.
regards
Romuald Besset
Hi
Does anyone have a hex converter / hex-dec/dec-hex procedure that can accept input param and give text result?
Please
Gill