|
Post by Kelly Ethridge on Nov 2, 2006 2:24:19 GMT -5
Creating arrays filled with data can be a long and drawn out process, especially when only a few elements are being created.
You can use the set of array constructors to easily create arrays filled with data specified in the constructor. All VB variable types have a constructor to make array creation easy.
Dim b() As Byte b = NewBytes(1, 2, 3, 4)
Dim l() As Long l = NewLongs(1, 2, 3, 4)
This example creates arrays with 4 elements, each containing the values 1, 2, 3, and 4. The arrays will have a lower bound of 0.
This provides a quick and easy way to create prefilled arrays. There is a constructor for each VB variable type.
|
|