I am having trouble working with multidimentional arrays, specifically string arrays. The compiler fails if trying to define it as per the angelscript manual:
Code: Select all
//A 10 x 10 array
string [][] str (10, string [] (10));
I found that it does not allow default values:
Code: Select all
//A 10 x 2 array with default value of "a"
string [][] str (10,"a");
However, it will allow the creation of multidimentional array with or without a length, but the execution halts when attempting to insert data.
Code: Select all
//Theoretical 10 x 2 array
string [][] str (10);
str [0][0] = "test";
This compiles correctly, but it fails in execution and stops processing anything else in the script. The only thing I can think of off hand is that it is 10 elements in length, but 0 elements wide, effectively creating a non-existant array. The same thing holds true for even more dimensions:
This also makes it through the compiler, but cannot be populated.
A 1 dimentional array works with no apparent issues:
Code: Select all
string [] str (10);
str [0] = "who";
str [1] = "what";