How do you clean an array in Axapta 3.0?

Can someone explain how to clear an array in Axapta 3.0?

+3
source share
2 answers

To free an Array object, just set it to zero:

Array myArray = new Array(Types::Integer);
;
myArray = null; //remove reference to Array so it will be garbage collected

In reset, we assign all elements of the array type to element 0:

int myArray[10];
;
myArray[0]=0; //reset all elements of the array to their default value
+5
source

Quote from msdn http://msdn.microsoft.com/en-us/library/aa653716.aspx

n X ++, null item [0] is used to clear the array! Assigning the value index 0 in the array resets all elements in the array to their default value. For example,

intArray [0] = 0; // Resets all elements in intArray

0
source

Source: https://habr.com/ru/post/1704801/


All Articles