Just to help clarify
MyString is a heap item with max length of 1024.
STRPRINT MyString Fill(0x31,1024)
That instruction moves the characters from the script into MyString, and sets MyString .Length to that generated script resulting length. In this specific situation, the script ends up being 1024 of the character "1" (0x31 is numeric equivalent of ASCII "1"), so the entire character buffer of MyString is filled with "1"s and .Length member gets set to 1024.
Then this gets executed
STRPRINT MyString "A"
Here, the script result is a single character "A", so the first character in MyString's buffer gets set to "A" and .Length gets set to 1 (.Length was 1024 from previous STRPRINT). The other 1023 characters in MyString buffer are not touched. Since .Length is 1, the contents of MyString starting at char 2 through char 1024 does not matter, although they will still contain the character "1" or 0x31 from the previous STRPRINT.
I wrote a Sim program to show this, copying the contents of MyString to N block (not MHR) (see MEMCOPY1_String.png). Leading Edge X0 fills MyString with "1" (0x31) and Leading Edge X1 sets MyString to the single letter "A" (0x41 BTW).
I show a couple screen shots of the contents of N0 through N513 (a copy of MyString structure memory) in HEXADECIMAL format in a Memory View
1. after X0 (MEMCOPY2_String.png)
2. after X1 (MEMCOPY3_String.png)
Note the values for N0 and N1 (WORDs of .MaxLength and .Length MyString struct fields in HEXADECIMAL), along with the value of the "text" in N2.
In the last screen shot, see how the contents of the MSBYTE of N3 through N513 are UNCHANGED (0x31) after turning X1 ON. .MaxLength is still 1024 (N0 is 0x400) but the .Length is 1 (N1 is 0x0001). N2, just the LSBYTE is changed (to 0x41 or "A", Little Endian, but N2's MSByte is still 0x31)