Notifications
Clear all

[Closed] Simple question (i think) about arrays and strings

I think it’s a simple question:

Let’s say i have an array

a= #(1,2,3,4,5)

No i turn this array into an string:

b= a as string
“#(1,2,3,4,5)”

Ok i have what i want, but in the end i want to turn this string into an array again, so how can i do that?

Cheers and thanks.

4 Replies
2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

a = #(1,2,3,4,5)
b = a as string
c = execute b -- now it's an array

but you have to know that long arrays can’t be correctly converted to a string… Check:


(for k=1 to 100 collect k) as string

(@ericdlegare)
Joined: 11 months ago

Posts: 0

Unless…

with printAllElements on 
(
	(for k=1 to 100 collect k) as string
)


As i understand is up to 20 values, is it?

More than that mas will resume the count and will print it with three dots.

Is there a way to jump above that or it’s a limitation of maxscript?

Cheers.

That’s great! Thanks Eric.