Message 1 of 4
question about array
Not applicable
04-28-2010
06:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! I am biginner of maxscripts.
I want to create 2D array.
so, I wrote the code under.
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex=j*k
)
linesx=linex
)
The answer of linesx I expected is
#(#(1, 2, 3), #(2, 4, 6), #(3, 6, 9))
but answer is
#(#(3, 6, 9), #(3, 6, 9), #(3, 6, 9))
Is there some mistake in my code?
To try
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex=j*k
)
linesx=linex
break()
)
When j=1 at breakpoint
linesx is #(#(1, 2, 3))
But j=2 at breakpoint
linesx is #(#(2, 4, 6), #(2, 4, 6))
I changed the code.
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex=j*k
)
append linesx linex
)
But,answer is the same.
Please tell me how to write code answer "#(#(1, 2, 3), #(2, 4, 6), #(3, 6, 9))".
I want to create 2D array.
so, I wrote the code under.
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex
)
linesx
)
The answer of linesx I expected is
#(#(1, 2, 3), #(2, 4, 6), #(3, 6, 9))
but answer is
#(#(3, 6, 9), #(3, 6, 9), #(3, 6, 9))
Is there some mistake in my code?
To try
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex
)
linesx
break()
)
When j=1 at breakpoint
linesx is #(#(1, 2, 3))
But j=2 at breakpoint
linesx is #(#(2, 4, 6), #(2, 4, 6))
I changed the code.
inex=#()
linesx=#()
for k= 1 to 3 do
(
for j = 1 to 3 do
(
linex
)
append linesx linex
)
But,answer is the same.
Please tell me how to write code answer "#(#(1, 2, 3), #(2, 4, 6), #(3, 6, 9))".