Dear,
I want to reserve in a binary file a part for max 32 characters.
In Scilab I tried:
myStr = blanks(32);
myStr(1:4) = ‘test’; // expected ‘test’ and the rest remaining blanks
// but myStr became ‘test’ only
So, if “myStr” is shorter than 32 characters, I guess I need to fill up the remaining places with blanks.
I need to write exactly 32 characters into the output binary file, because if this is loaded in another software, it expects exactly 32 characters.
Writing the string into the binary file I currently use:
fd = mopen(fileNmae, “wb”);
mputstr( myStr, fd);
mclose(fd);
Question 1: Is this the correct procedure?
Question 2: Is there something like mputstr(n, myStr, fd);
with n beeing the nr of chars to write and
if length(myStr) < n the remaining chars would be filled with blanks ?
Thank you,
Philipp