如何清空Axapta 3.0中的数组?

时间:2009-03-16 01:15:49

标签: arrays axapta

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

2 个答案:

答案 0 :(得分: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

答案 1 :(得分:0)

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

  

n X ++,项目零[0]用于清除数组!为...分配值   数组中的索引0将数组中的所有元素重置为默认值   值。例如,

     

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