>got yesterdays problems sorted out but here's one for fun. I have a
pointer
>to a structure made up of a number of bytes, of which the length is known.
>In C, I can iterate from that pointer to length, casting each as a byte and
>get a dump of what's in the structure something along the likes of
>
>while(intCount--)
> {
> myByte = (BYTE *)ptr++;
> // Output the byte to a file
> }
>
>Suggestions for quick and dirty Delphi conversion?
for i := 0 to intcount-1
do begin
myByte := (ptr as PByteArray)[i];
// Output the byte to a file
end;
PChar might work too - except there's the bit about them being
"null-terminated" and I'm not sure if it's a problem to index
past the null.
hope i haven't missed something here
ns
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"