如何在 Axapta 3.0 中清空数组?

3

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

2个回答

5

要释放一个数组对象,只需将其赋值为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

0

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

在 X++ 中,使用 item zero[0] 来清除数组!将值分配给数组中的索引 0 将重置数组中的所有元素为默认值。例如:

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接