Removing


Clear method

You can clear a portion of an array with the Clear method.

System.Array.Clear(ArrayName, Index, Length) 

ArrayName - The array you want to clear
Index - The starting index of the range of elements to clear
Length - The number of elements to clear


clsComponent gaComponentArray(10, 20) 
System.Array.Clear(gaComponentArray, 0, (10 + 1) * (20 + 1))

Another feature is the Clear method. So, if you clear element 2 for instance and you try referencing its length property afterward, you are going to raise a null reference exception.

Array.Clear(aiArrayIntegers, 0, 1) 



© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext