08-29-2017 07:07 AM - edited 08-29-2017 07:10 AM
Hello Community!
I have an array of strings that needs to be written to a binary file. However, I have to keep the format of the file. That being 81 bytes per string to an amount of 40 strings in total. If the string array is smaller they need to be filled with unsigned bytes. Any ideas? Thank you very much in advance for the answer.
08-29-2017 07:36 AM
How about...
Start with a string constant of 81 bytes containing the "fill" you need. Then use "Replace Substring" to insert your text into the string overwriting the first part and there you go!
Ben
08-29-2017 07:37 AM
Pad your strings prior to the binary write. You could combine your padding with limiting (to a maximum of 40) the amount of elements taken from the array.
08-29-2017 08:15 AM - edited 08-29-2017 08:17 AM
Second thought. Format Into String is a poor choice, go for Replace Substring as Ben suggested, it gives you flexibility to define your padding character.