>Hi
>I am using the MSComm control within a VFP app to capture serial data. If you use the comm control to receive binary data, it is stored in the controls receive buffer as a byte array. How can I access this byte array from VFP in order to write the data out to a file?
>
>Thanks and regards
>Bill
Bill,
I never tried MScomm with binary data but guess it's like VFP to SQL server's image type. Each byte value is converted to its hex char representation while sending and converted back to one byte on receiving end (ie: 255 goes as "FF"). If so get the data as string first and then write out in pairs :
for ix=1 to len(Str) step 2
=fwrite(hout,evaluate('0x'+substr(Str,ix,2)))
endfor
PS: A byte array might represent the actual binary data as is, a structure, a unicode string (strconv()) etc. W/o knowing the format what I said might be totally wrong.
Cetin