Inserts or replaces a specific attribute, value, or sub-value in a clsD3DynamicArray object.
object.brReplace oDynArrayReplace, vnAMC, [ vnVMC], [ vnSVMC]
Parameter | Description |
---|---|
object | An object variable that represents a clsD3DynamicArray object. |
oDynArrayReplace | An object variable that represents a clsD3DynamicArray object containing the replacement element. |
vnAMC | A Variant (Long subtype) specifying the attribute mark count where the replacement will begin. |
vnVMC | Optional. A Variant (Long subtype) specifying the value mark count where the replacement will begin. |
vnSVMC | Optional. A Variant (Long subtype) specifying the sub-value mark count where the replacement will begin. |
The brReplace method has the same functionality as the brReplaceStr method, except that the replacement element is passed as a dynamic array (oDynArrayReplace) in brReplace, and as a string in brReplaceStr.
Sub Main() Dim oEnv As New clsD3Environment Dim oConn As clsD3Connection Dim oArray As New clsD3DynamicArray Dim oContinent As New clsD3DynamicArray Dim lFound As Long Set oConn = oEnv.brOpenConnection("ODBC", "production”) oArray.brCString = "Europe" & D3VMChr & "South America" & D3VMChr & "Africa" oContinent.brCString = InputBox("Enter a continent") If oArray.brLocate(oContinent, lFound, 1) = True Then oContinent.brCString = InputBox(oContinent.brCString & " is already there. Enter replacement") oArray.brReplaceoContinent, 1, lFound Else oArray.brInsert oContinent, -1 End If MsgBox oArray.brCString oEnv.brCloseConnection oConn Set oArray = Nothing Set oContinent = Nothing Set oEnv = Nothing End Sub
replace