BinToHex conversion and back (was:Re: [fpc-devel] InstantObjects)

Jan Ruzicka jan.ruzicka at comcast.net
Tue Feb 1 13:29:32 CET 2005


On Feb 1, 2005, at 04:11, Marco van de Voort wrote:

>> On Tue, 1 Feb 2005 uberto at gama-soft.com wrote:
>
>>> Classes:
>>> 1 - fpc lacks a HexToBin and BinToHex functions. [It has them but 
>>> only as
>>> private methods of TParser]
>>
>> These functions are in sysutils or strutils. They have no place in
>> Classes.
>
> I started these, but are now to busy now to test, if sb is bored:
>
> http:/www.stack.nl/~marcov/bintohex.txt
>

Why don't you use a translation table to convert character to hex?
The conversion table can be shared with other information like flags 
"is upper", "is lower", "is alpha", "is hex", "is digit".

Shouldn't the binvalue in BinToHex be increased  only by 1 instead of 
current 2 ?
inc(binvalue,2);

Jan

>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>





More information about the fpc-devel mailing list