Inserts an element, passed as a clsD3DynamicArray object, into the specified attribute, value, or sub-value location in the clsD3DynamicArray object.
object.brInsert oDynArray, nAMC, [ nVMC], [ nSVMC]
Parameter | Description |
---|---|
object | An object variable that represents a clsD3DynamicArray object. |
oDynArray | An object variable that represents a clsD3DynamicArray object that is the element to insert. |
nAMC | A Long indicating the attribute mark count where the insertion will be. |
nVMC | Optional. A Long indicating the value mark count where the insertion will be. |
nSVMC | Optional. A Long indicating the sub-value mark count where the insertion will be. |
By specifying -1 for nAMC, nVMC, or nSVMC, the element is inserted as the last element in the specified location.
Sub Main() Dim oEnv as New clsD3Environment Dim oDynArray1 As clsD3DynamicArray Dim oDynArray2 As clsD3DynamicArray Dim oDynArray3 As clsD3DynamicArray ’ Allocate an empty dynamic array Set oDynArray1 = oEnv.brOpenDynamicArray ’ Fill the dynamic array oDynArray1.brInsertStr "Quinn", 1 ’ Attribute 1 oDynArray1.brInsertStr "Joe", 2, 1 ’ Attribute 2, Value 1 oDynArray1.brInsertStr "Sue", 2, 2 ’ Attribute 2, Value 2 Debug.Print oDynArray1.brCString ’ Allocate a dynamic array with one element Set oDynArray2 = oEnv.brOpenDynamicArray("Quinn") Set oDynArray3 = oEnv.brOpenDynamicArray oDynArray3.brCString = "Joe" & D3VMChr & "Sue" ’ Insert a dynamic array into the another oDynArray2.brInsertoDynArray3, 2 ’ oDynArray3 is now attribute 2 of oDynArray2 ’ Same result as oDynArray1 Debug.Print oDynArray2.brCString End Sub
insert