Inserts a string into the specified attribute, value, or sub-values location in a clsD3DynamicArray object.
object.brInsert sStr, nAMC, [ nVMC], [ nSVMC]
Parameter | Description |
---|---|
object | An object variable that represents a clsD3DynamicArray object. |
sStr | A String 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 oArray1 As New clsD3DynamicArray Dim oArray2 As New clsD3DynamicArray Dim oArray3 As New clsD3DynamicArray ' Constructing a dynamic array - method 1. ' Inserting attributes and values into a dynamic array. oArray1.brInsertStr"Hammersmith", 1 oArray1.brInsertStr"Joe", 2, 1 oArray1.brInsertStr"Sally", 2, 2 ' Constructing a dynamic array - method 2. ' Using -1, inserts the string as the last ' element in that position. oArray2.brInsertStr"Hammersmith", 1 oArray2.brInsertStr"Joe", 2, -1 oArray2.brInsertStr"Sally", 2, -1 ' Constructing a dynamic array - method 3. oArray3.brCString = "Hammersmith" & D3AMChr & "Joe" & D3VMChr & "Sally" Debug.Print oArray1.brCString Debug.Print oArray2.brCString Debug.Print oArray3.brCString If oArray1.brEqual(oArray2) Then Debug.Print "The dynamic arrays are equal" End If If oArray1.brEqual(oArray3) Then Debug.Print "The dynamic arrays are equal" End If Set oArray1 = Nothing Set oArray2 = Nothing Set oArray3 = Nothing Set oEnv = Nothing End Sub
insert