3

有人可以详细说明如何在 Axapta 3.0 中清空数组吗?

4

2 回答 2

5

要释放 Array 对象,只需将 null 分配给它:

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

要重置数组类型的所有元素,请为元素 0 赋值:

int myArray[10];
;
myArray[0]=0; //reset all elements of the array to their default value
于 2009-03-16T15:09:42.147 回答
0

引用自 msdn http://msdn.microsoft.com/en-us/library/aa653716.aspx

n X++, item zero[0] 用于清空数组!将值分配给数组中的索引 0 会将数组中的所有元素重置为默认值。例如,

整数数组[0] = 0;//重置intArray中的所有元素

于 2012-11-12T10:17:22.087 回答