Aller au contenu

Photo

Scripting Array of Arrays


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
gastank

gastank
  • Members
  • 1 messages
Anyone know if the scripting engine allows use of array of arrays? Something like:

string[][] arrayList;
int i, j;

for (i = 0, i < 5, i++) {
    for (j = 0, j < 5, j++) {
        arrayList[i][j] = IntToString(i + j);
    }
}

Modifié par gastank, 13 septembre 2010 - 08:24 .


#2
FergusM

FergusM
  • Members
  • 460 messages
Not really.



You can't actually allocate memory for arrays yourself, you may notice. It always needs to be returned by a function to start out. This is because the scripting system sits atop the code proper, which is what is managing memory.You can search for the talmud project, which gives you a little more control over your own arrays. It may allow you to hack together multi-dimensional arrays.