View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 05:10   Re: [ TUT ]Dynamic Array
Reply With Quote #29

Quote:
Originally Posted by HamletEagle View Post
I told you before, stop seeing things as a whole and analyze them piece by piece.
I'm pushing the numbers one by one, so I'm saving single-cell data. Here you have a dynamic array of numbers.
addons is saving the entire array once, he has multi-cell data. Here you have a dynamic array of arrays.

My snippet translates to:
Code:
0
1
2
3
4
5
6
7
8
9

//the dynamic array has 10 elements
"cellsize" param is 1 because, again, we are saving numbers.

addon's snippet translates to:
Code:
{2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647}

//the dynamic array has 1 element(only one array)
"cellsize" param is 7 because that's the size of the array that you will save.

Another example:
PHP Code:
new Array1[] = {01,3}
new 
Array2[] = {4567}
new 
Array3[] = {891011}

new Array:
Test ArrayCreate(4//4 because that's the array size.
ArrayPushArray(TestArray1)
ArrayPushArray(TestArray2)
ArrayPushArray(TestArray3
It "looks" like:
Code:
{0, 1, 2, 3}
{4, 5, 6, 7}
{8, 9, 10, 11}

//array has 3 elements.
We have 12 numbers, but they are organized in arrays, and each array is pushed into the dynamic array.
Thank you! I just didn't notice the loop you made. Now I understand it. Thanks again.
__________________
edon1337 is offline