Using your Fill procedure and your TIDBytes definition: procedure Test; var s: ansistring; b: TIDBytes; begin ...
stackoverflow.com