[fpc-pascal] represent data string in hex?

wkitty42 at windstream.net wkitty42 at windstream.net
Sat Sep 21 17:56:17 CEST 2013


On Saturday, September 21, 2013 6:27 AM, patspiper <patspiper at gmail.com> wrote: 
> On 21/09/13 12:15, wkitty42 at windstream.net wrote: 
[trim]
> > yeah, the singles are bad examples... i'm really wanting the multiple byte 
> > format to work... i tried both and was told "expected string but found byte" or 
> > "word"... it is for a translation table... in quoted-printable, everything is 
> > equalsXX... the same codes are used in utf-8... so i thought if i could just 
> > copy them directly into my array and then change the equals to dollar... 
> > 
> > i ended up getting it to work by wrapping each piece with chr() but that's 
> > really ugly visually when looking at the code to see the side by side character 
> > and replacement tables... 
> > 
> > a[n] := chr($C2)+chr($AD) for two byte codes... 
> What about a[n] := #$C2#$AD? 

i haven't tried that... my understanding is that #xx depicts the decimal format of the character...

eg : $FF == #255

but the data i'm working with is in hex format and trying to convert to use the actual characters or converting the hex to decimal is grue... especially when trying to create and maintain the static data tables i'm attempting to build...

anyway, i'll try to find something with regard to using #$C2... hopefully i won't have to spend much time locating anything ;)





More information about the fpc-pascal mailing list