0010
12-30-2005, 03:01 PM
Hi all !!
i'm new of this language and i've encountered a problem with the multidimensional arrays.
In the 9,5 SDK i've found it's possible declare a two dim. array with the command :
var my_array=new(array,3,3);
the problem is that it doesn't work ... if i try to put some data inside with for example :
my_array[2,2] = something --- or --- my_array[2][2] = something
it doesn't work ... i don't have find a good example to follow ... so i'm asking to the best and largest comunity of 3d in the world !!!
i've write a fast test where i don't understand the error :
main(doc,op)
{
var x = int(3);
var y = int(3);
var arr=new(array,3,3);
var i ;
var j ;
for (i=0;i<x;i++)
{
for (j=0;j<y;j++)
{
arr[i,j]=0;
}
}
arr[0,1]=3;
arr[2,2]=5;
for (i=0;i<x;i++)
{
for (j=0;j<y;j++)
{
println(arr[i,j]);
}
}
}
thank you very much for your help !!!
any suggestion are welcome !!!
i'm new of this language and i've encountered a problem with the multidimensional arrays.
In the 9,5 SDK i've found it's possible declare a two dim. array with the command :
var my_array=new(array,3,3);
the problem is that it doesn't work ... if i try to put some data inside with for example :
my_array[2,2] = something --- or --- my_array[2][2] = something
it doesn't work ... i don't have find a good example to follow ... so i'm asking to the best and largest comunity of 3d in the world !!!
i've write a fast test where i don't understand the error :
main(doc,op)
{
var x = int(3);
var y = int(3);
var arr=new(array,3,3);
var i ;
var j ;
for (i=0;i<x;i++)
{
for (j=0;j<y;j++)
{
arr[i,j]=0;
}
}
arr[0,1]=3;
arr[2,2]=5;
for (i=0;i<x;i++)
{
for (j=0;j<y;j++)
{
println(arr[i,j]);
}
}
}
thank you very much for your help !!!
any suggestion are welcome !!!
