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

Marco van de Voort marcov at stack.nl
Tue Feb 1 14:00:00 CET 2005


> On Feb 1, 2005, at 04:11, Marco van de Voort wrote:
> >> 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".

Large table and except digit and hex the rest is locale dependant.
 
> Shouldn't the binvalue in BinToHex be increased  only by 1 instead of 
> current 2 ?
> inc(binvalue,2);

I think so yes. hextobin should increase with 2, so bintohex with 1




More information about the fpc-devel mailing list