THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/12/2012 at 03:45, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) :
---------
Hi Folks,
I have a GeAutoDynamicArray that I'm playing about with, but I'm having all sorts of troubles with not being able to set values correctly. My basic array setup is below - there's a bit missing to keep code size down (just some if's and else's etc), but this is the base setup. For the example below I've used 3 index's that can store reals. All index in the array are filled with something, even if it's "0".
----- in EXECUTE function -----
GeAutoDynamicArray<float> MyArray(Array_Count); // Array_Count = LONG taken from user data
// then I have my 'for" statement down the code a bit (still in EXECUTE though) :
for(int cnt=1;cnt<=Array_Count) // a new array is made for each Array_Count value.... this ok so far?
{
MyArray.ReSize(cnt); // increase array to the size of Array_Count
MyArray[cnt] = MyArray.Insert(25,0) // 1st index
MyArray[cnt] = MyArray.Insert(0,1) // 2nd index
MyArray[cnt] = MyArray.Insert(12,2) // 3rd index
cnt++; //
}
----- END EXECUTE etc -----
Now, when I add to the Array_Count LONG, the array is putting a "1" into the equivalent LONG number's index count. For example, if the Array_Count = 1, then a 1 is put into MyArray.Insert(1,0) instead of 25 for the first index. If Array_Count = 2, then MyArray 2nd index becomes MyArray.Insert(1,1) instead of (0,1) etc. And also the first index goes back to being 25. Hope that makes sense...
What could be/is going on here? regards,
WP.