On 09/09/2013 at 13:17, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14
Platform: Mac ;
Language(s) : C++ ;
---------
Hello, I recently switched over to sing R14 because of Jack's post about how much faster BaseArray was than GeDynamicArray. Anyway, I might be totally wrong, but I've been trying to use GetIndex() to find the location of elements in the array and it always returns not found. From what the SDK says and trying to figure it out myself, it looks like it can only find the location if I use the array entry in GetIndex(), otherwise it always returns -1.
c4d_misc::BaseArray<LONG> test;
test.Append(0);
test.Append(1);
test.Append(2);
test.Append(3);
test.GetIndex(2); // returns -1
test.GetIndex(test[2]); //so it's still looking for "2" and it correctly returns 2 this time
It seems like you could only use GetIndex() if you already knew what location of the element you're looking for. I'm sure I'm wrong but I can't find a way around it and would appreciate any help.
Thanks, Daniel