brReplaceStr method

Inserts or replaces a specific attribute, value, or sub-value in a clsD3DynamicArray object.

Syntax

object.brReplaceStr sReplace, vnAMC, [ vnVMC], [ vnSVMC]

Parameters

Parameter Description
object An object variable that represents a clsD3DynamicArray object.
sReplace A String 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.

Remarks

The brReplaceStr method has the same functionality as the brReplace method, except that the replacement element is passed as a string in brReplaceStr (sReplace), and as a dynamic array in brReplace.

Example

Sub Main()
   Dim oEnv As New clsD3Environment
   Dim oConn As clsD3Connection
   Dim oFile As clsD3File
   Dim oArray As clsD3DynamicArray
   Dim lName As Long
   Dim lTitle As Long
 
   Set oConn = oEnv.brOpenConnection("ODBC;", "Production") 
 
   ' Open the file.
   Set oFile = oConn.brOpenFile("Customers")
 
   ' Resolve attribute names.
   lName = oFile.brColumn("contactname")
   lTitle = oFile.brColumn("contacttitle")
 
   ' Read the record for customer "13".
   Set oArray = oFile.brReadU("13")
 
   ' Change the attributes in the dynamic array.
   oArray.brReplaceStr"Bob Smith", lName
   oArray.brReplaceStr"Vice President", lTitle
 
   ' Write the record back.
   oFile.brWrite oArray, "13"
 
   oConn.brCloseFile oFile
   oEnv.brCloseConnection oConn
   Set oEnv = Nothing
End Sub

FlashBASIC reference

replace