While testing out various data types available in the engine's scripting language I found an odd quirk. You can't have an array of size 1.
An array of size 2 is fine:
But an array of size 1 will error on assignment:
Is this just one of many quirks or is there some logic to this?
It's actually possible to work around this by shrinking the array after its creation:
An array of size 2 is fine:
Code:
int list[2];
list[0] = 123;
But an array of size 1 will error on assignment:
Code:
int list[1];
list[0] = 123; // error.log: function 'ExecuteConsole' stack error
Is this just one of many quirks or is there some logic to this?
It's actually possible to work around this by shrinking the array after its creation:
Code:
int list[2];
SetArraySize(&list, 1);
list[0] = 123;
trace("array size : " + GetArraySize(&list));
trace("list[0] : " + list[0]);
Last edited: