09-11-2017 05:29 AM
Hello Community
I am trying to write to a binary file that is read with Delphi as well as with LabView. While writing strings in the binary file Delphi uses 1 byte at the beginning for the string length and then writes the string. LabView does it differently though. Any Ideas of how can I write a byte array of a string replicating the Delphi format?
Thanks in advance
Solved! Go to Solution.
09-11-2017 05:47 AM
Hi Ana,
switch off the array/string size when writing the string to your binary file (it's an input parameter of the WriteBinaryFile function)!
Then write your own string length indication byte in front of the string (or prepend the length byte to the string data)…
09-11-2017 06:03 AM
HI,
You can simply everytime write at fisrt time an octet into binary file, before to write your data(String).
This obligate you to use fonction write to Binary file two time successively.
09-11-2017 06:21 AM - edited 09-11-2017 06:21 AM
I am in the boat of prepending the length byte to your data before writing to the file.
09-11-2017 08:54 AM
So how does Delphi handle strings longer than 255 bytes?
/Y