Notifications
Clear all

[Closed] array as string

Hi,

I am currently writing a little transfer script that allows me to transfer meshes down a max version and use arrays that I convert to strings. I use something like this:

str = arr as string

Now when the array gets very long sometimes in the string conversion MAX cuts off the last elements and replaces them in the string with “…”

I was wondering if there is any way around that so I can convert the full array to a string ?

4 Replies

options.printallelements = true
Will do what you want.

-Eric

or you can use:

with printAllElements on <code>

only difference being that the above is exception safe

Ahhhh, perfect !!! Thanks alot, guys! I did not know something like that existed. In my opinion this should be on by default. Is it because of buffer overruns or why is it disabled ?

i think its off by default because it can be really slow with large arrays of 1000s of items or more, and i guess its slow because it has to create such a massive string. formatting items to a stringstream one by one in a loop should be pretty fast. slightly more code but it gives you more control of the resulting string.