How to count elements of array
I'm using c#script (basically jscript in disguise).
What I want to do seems pretty simple but I just can't seem to figure it out. I just want to know how many elements exist in an array. Here's a small test that I tried:
var elements = new Array("Thing1", "Thing2", "Thing3");
Log["Message"]("Array Elements = " + elements.count);
Log["Message"]("Array Elements = " + elements["count"]);
Log["Message"]("Array Elements = " + elements.count());
None of these work - the last one actually throws an exception.
Can anyone help me please as this is driving me around the twist. Especially when the ever useful TC help states:
Use the ArrayType.Count property to get the total number of items in the array.
Use the ArrayObject.Count property to get the total number of items in ArrayObject_Obj.
With of course no examples to demonstrate that this actually works.
Re: How to count elements of array
Never mind I found it of course it's....length!!!
I give up.