[fpc-pascal] represent data string in hex?

wkitty42 at windstream.net wkitty42 at windstream.net
Sat Sep 21 18:36:05 CEST 2013


On Saturday, September 21, 2013 12:03 PM, patspiper <patspiper at gmail.com> wrote: 
> On 21/09/13 18:56, wkitty42 at windstream.net wrote: 
> > 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: 
...
> >>> 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 
> It is rather #$FF which is the same as #255, like Chr(255) 

i have never ever used #$FF in 30 years of programing with a pascal dialect... only #FF when writing or checking for data in hex format... but this is the first time that i'm needing/wanting to depict it in a static array as a (end result) string of characters to search for and replace with the StringsReplace routine available in FPC... in the past, i would have written my own but since this one exists, it makes things much easier ;) :)

i will take a look... if it works, i've learned something new since my days of coding with borland pascal ;)





More information about the fpc-pascal mailing list