VBspeed / VB6 to VB5 / Replace
VBspeed © 2000-10, updated: 10-Dec-2001
Replace


The Definition
Function Replace
Returns a string in which a specified substring has been replaced with another substring a specified number of times.
Native to VB6, but not to VB5.
Declaration:
Replace(Expression, Find, ReplaceWith[, Start[, Count[, Compare]]])
Arguments:
ExpressionRequired. String expression containing substring to replace.
FindRequired. Substring being searched for.
If Find is zero-length, Replace returns a copy of Expression.
ReplaceWithRequired. Replacement substring.
If ReplaceWith is zero-length, Replace returns a copy of Expression with all occurences of Find removed.
StartOptional. Position within expression where substring search is to begin.
If omitted, 1 is assumed. Must be used in conjunction with count.
CountOptional. Number of substring substitutions to perform.
If omitted, the default value is -1, which means make all possible substitutions.
Must be used in conjunction with start.
CompareOptional. Numeric value indicating the kind of comparison to use when evaluating substrings.
If omitted, the default value is 0, which means perform a binary comparison.
Remarks:
VB6 Replace features a very bizarre interpretation of the Start parameter that can be paraphrased as follows:
  ' *before* any replacements
  Replace = Mid$(Expression, Start)
Until anybody reveals the deeper meaning of this, we will not care about it in our emulations.
You may use this function (VB5/6-compatible) to verify the correctness of your emulation code.


The Charts
Calls
 sRet = Replace(Expression, Find, ReplaceWith, , , Compare)
Call 1 Expression = "hahahahahahahahahaha"
Find = "a", ReplaceWith = "i!" (different length)
Call 2 Expression = "hahahahahahahahahaha"
Find = "a", ReplaceWith = "i" (same length)
Call 3 Expression = "hahahahahahahahahaha"
Find = "ha", ReplaceWith = "blahblah" (adjacent replacements, ReplaceWith larger)
Call 4 Expression = Replicate(10, "blahblah")
Find = "blahblah", ReplaceWith = "ha" (adjacent replacements, ReplaceWith smaller)
Call 5 same as Call 4, but:
Compare = vbTextCompare (all other calls: Compare = vbBinaryCompare)
Call 6 Expression = Replicate(10, "xx" & Space$(10000)) & "xx"
Find = "x", ReplaceWith = Space$(10000) (large strings)

Note that this new test case proved previous submissions Replace03 and Replace04 as faulty! Consequently they have been excluded from the competition (the code remains on the page for reference: it's good to remember mistakes).
 VB5
CodeAuthorDopingNotes
ReplaceVB6  
Replace01 Donald  
Replace02 Donald  
Replace05 Jost  
Replace06 Donald  
Replace07 GuidoAPI,TLB 
Replace08 Jost  
Replace09 Jost  
Replace10 OlafAPIStooges
Replace11 GuidoAPI,TLB 
Call 1
   
812.7053.107Ás
712.3151.462Ás
55.7624.103Ás
66.6927.993Ás
23.9116.357Ás
45.0120.960Ás
34.7319.790Ás
X1.054.398Ás
11.004.181Ás
Call 2
   
820.9453.040Ás
73.218.121Ás
63.178.036Ás
53.168.012Ás
42.907.335Ás
32.626.644Ás
22.596.572Ás
X1.172.964Ás
11.002.533Ás
Call 3
   
89.3955.849Ás
79.1754.503Ás
42.0412.144Ás
62.7316.229Ás
52.6515.737Ás
21.669.859Ás
31.7510.429Ás
X1.116.574Ás
11.005.947Ás
Call 4
   
89.3654.823Ás
79.0753.101Ás
41.589.231Ás
62.3613.800Ás
52.3313.627Ás
31.307.621Ás
21.287.490Ás
X1.126.575Ás
11.005.855Ás
Call 5
   
548.80306.570Ás
448.11302.241Ás
653.10333.593Ás
7100.29630.026Ás
8100.55631.626Ás
36.5641.236Ás
26.3539.909Ás
X1.328.293Ás
11.006.282Ás
Call 6
   
840.82316,880Ás
740.65315,550Ás
63.1024,026Ás
32.8622,189Ás
22.0916,255Ás
43.0123,339Ás
53.0323,528Ás
X1.038,028Ás
11.007,763Ás
 VB6
CodeAuthorDopingNotes
Replace VB6  
Replace01 Donald  
Replace02 Donald  
Replace05 Jost  
Replace06 Donald  
Replace07 GuidoAPI,TLB 
Replace08 Jost  
Replace09 Jost  
Replace10 OlafAPIStooges
Replace11 GuidoAPI,TLB 
Call 1
711.5947.362Ás
912.8552.496Ás
812.8152.329Ás
56.1825.255Ás
67.1529.225Ás
24.0516.531Ás
34.8519.808Ás
44.9220.102Ás
X1.094.464Ás
11.004.086Ás
Call 2
817.6645.831Ás
920.2152.452Ás
63.288.506Ás
73.338.639Ás
53.278.487Ás
42.757.138Ás
32.676.936Ás
22.646.844Ás
X1.173.049Ás
11.002.595Ás
Call 3
77.5845.061Ás
99.3255.433Ás
89.3055.313Ás
41.569.303Ás
62.2713.476Ás
52.1913.042Ás
21.257.429Ás
31.287.634Ás
X1.116.620Ás
11.005.947Ás
Call 4
77.9146.766Ás
99.6757.193Ás
89.6256.903Ás
41.7510.360Ás
62.6815.872Ás
52.6415.608Ás
31.458.570Ás
21.448.503Ás
X1.156.799Ás
11.005.915Ás
Call 5
413.4581.659Ás
549.45300.259Ás
649.50300.529Ás
756.14340.895Ás
9106.26645.215Ás
8106.26645.209Ás
26.7741.078Ás
36.9342.071Ás
X1.418.550Ás
11.006.072Ás
Call 6
31.5512,793Ás
938.36317,618Ás
837.66311,806Ás
71.8615,399Ás
41.6213,375Ás
21.149,466Ás
61.7714,622Ás
51.6513,652Ás
X1.008,301Ás
11.008,279Ás
Conclusions
Again, a VB6 native function could be beaten by simple straightforward VB code (even without any API). And: the Replace-replacements don't come with the weird Mid$-"feature" (see Remarks above).
Where old and new substring have the same length (Call 2), VB6 is actually thrown to pieces (even the non-doped emulation is more than 5 times faster!). Same holds for Calls 3/4/5, which is harder to explain.
Mail your code! How to read all those numbers


The Code
Replace01
submitted 18-Sep-2000 by Donald Lessau  
Doping: none
Public Function Replace01(Expression As String, _
    sOld As String, _
    sNew As String, _
    Optional ByVal Start As Long = 1, _
    Optional Count As Long = -1, _
    Optional Compare As VbCompareMethod = vbBinaryCompare) As String

' by Donald, donald@xbeat.net, 20000918
  Dim cntReplace As Long
  Dim lenOld As Long
  Dim lenNew As Long
  
  Replace01 = Expression
  lenOld = Len(sOld)
  
  If lenOld Then
    lenNew = Len(sNew)
    ' silently correct illegal Start value
    If Start < 1 Then
      Start = 1
    End If
    Do Until cntReplace = Count
      Start = InStr(Start, Replace01, sOld, Compare)
      If Start Then
        ' replace
        Replace01 = Left$(Replace01, Start - 1) & sNew & Mid$(Replace01, Start + lenOld)
        cntReplace = cntReplace + 1
        ' next pos
        Start = Start + lenNew
      Else
        Exit Do
      End If
    Loop
  End If
  
End Function
Author's comments:
Donald's comments:

top | charts


Replace02
submitted 18-Sep-2000 by Donald Lessau  
Doping: none
Public Function Replace02(Expression As String, _
    sOld As String, _
    sNew As String, _
    Optional ByVal Start As Long = 1, _
    Optional Count As Long = -1, _
    Optional Compare As VbCompareMethod = vbBinaryCompare) As String

' by Donald, donald@xbeat.net, 20000918
  Dim cntReplace As Long
  Dim lenOld As Long
  Dim lenNew As Long
  
  Replace02 = Expression
  lenOld = Len(sOld)
  
  If lenOld Then
    ' silently correct illegal Start value
    If Start < 1 Then
      Start = 1
    End If
    ' fixed value to fast var
    lenNew = Len(sNew)
    
    If lenOld = lenNew Then
      ' can use faster replace algorithm
      Do Until cntReplace = Count
        Start = InStr(Start, Replace02, sOld, Compare)
        If Start Then
          ' replace
          Mid$(Replace02, Start) = sNew
          cntReplace = cntReplace + 1
          ' next pos
          Start = Start + lenNew
        Else
          Exit Do
        End If
      Loop
    
    Else
      Do Until cntReplace = Count
        Start = InStr(Start, Replace02, sOld, Compare)
        If Start Then
          ' replace
          Replace02 = Left$(Replace02, Start - 1) & sNew & Mid$(Replace02, Start + lenOld)
          cntReplace = cntReplace + 1
          ' next pos
          Start = Start + lenNew
        Else
          Exit Do
        End If
      Loop
    End If
  End If
  
End Function
Author's comments: The Mid$ statement is a lot faster than concatenation and can be easily employed when old and new substring have the same length.
Donald's comments:

top | charts


Replace03
submitted 18-Sep-2000 by Donald Lessau  
Doping: none
Public Function Replace03(Expression As String, _
    sOld As String, _
    sNew As String, _
    Optional ByVal Start As Long = 1, _
    Optional Count As Long = -1, _
    Optional Compare As VbCompareMethod = vbBinaryCompare) As String

' by Donald, donald@xbeat.net, 20000918
  Dim cntReplace As Long
  Dim lenOld As Long
  Dim lenNew As Long
  Dim StartPrev As Long
  Dim posReplace As Long
  
  lenOld = Len(sOld)
  
  If lenOld Then
    ' silently correct illegal Start value
    If Start < 1 Then
      Start = 1
    End If
    ' fixed value to fast var
    lenNew = Len(sNew)
    
    If lenOld = lenNew Then
      ' can use faster replace algorithm
      Replace03 = Expression
      Do Until cntReplace = Count
        Start = InStr(Start, Replace03, sOld, Compare)
        If Start Then
          ' replace
          Mid$(Replace03, Start) = sNew
          cntReplace = cntReplace + 1
          ' next pos
          Start = Start + lenNew
        Else
          Exit Do
        End If
      Loop
    
    Else
      If lenNew Then
        ' make space for largest possible return
        ' Crashes when the resulting string is too large!
        Replace03 = Space$(Len(Expression) * lenNew)
      Else
        Replace03 = Space$(Len(Expression))
      End If
      StartPrev = 1
      posReplace = 1
      Do Until cntReplace = Count
        Start = InStr(Start, Expression, sOld, Compare)
        If Start Then
          ' replace: insert using fast Mid$ statement
          Mid$(Replace03, posReplace) = Mid$(Expression, StartPrev, Start - StartPrev)
          Mid$(Replace03, posReplace + (Start - StartPrev)) = sNew
          ' next pos in Replace
          posReplace = posReplace + (Start - StartPrev) + lenNew
          ' next search pos in Expression
          Start = Start + lenOld
          ' store
          StartPrev = Start
          ' count
          cntReplace = cntReplace + 1
        Else
          Exit Do
        End If
      Loop
      ' trim unused target buffer and add source remainder
      Replace03 = Left$(Replace03, posReplace - 1) & Mid$(Expression, StartPrev)
    End If
  Else
    Replace03 = Expression
  End If
  
End Function
Author's comments: With only a little more effort the Mid$ statement can also be employed when old and new substring have different lengths.
Donald's comments:

top | charts


Replace04
submitted 25-Sep-2000 by Keith Matzen  
Doping: none
Public Function Replace04(sExpression As String, _
                          sOld As String, _
                          sNew As String, _
           Optional ByVal lStart As Long = 1, _
                 Optional lCount As Long = -1, _
                 Optional lCompare As VbCompareMethod = vbBinaryCompare) As String

' by Donald, donald@xbeat.net, 20000918
' modified by Keith, kmatzen@ispchannel.com
 
   Dim lNumReplaced As Long
   Dim lLenOld      As Long
   Dim lLenNew      As Long
   Dim lPosExpr     As Long
   Dim lPosRepl     As Long
   Dim lStrLen      As Long
   Dim lLenExpr     As Long
   
   lLenOld = Len(sOld)
   
   If lLenOld Then
      ' silently correct illegal lStart value
      If lStart < 1 Then
         lStart = 1
      End If
      ' fixed value to fast var
      lLenNew = Len(sNew)
      
      If lLenOld = lLenNew Then
      
         ' can use faster replace algorithm
         Replace04 = sExpression
         Do Until lNumReplaced = lCount
            lStart = InStr(lStart, Replace04, sOld, lCompare)
            If lStart Then
               ' replace
               Mid$(Replace04, lStart) = sNew
               lStart = lStart + lLenNew   ' next pos
               lNumReplaced = lNumReplaced + 1
            Else
               Exit Do
            End If
         Loop
     
      Else
      
         lLenExpr = Len(sExpression)
         If lLenNew > lLenOld Then
            ' make space for largest possible return
            ' Save memory for case when lLenOld <> 1
            ' Crashes when the resulting string is too large!
            Replace04 = Space$(lLenExpr + (lLenExpr \ lLenOld) * (lLenNew - lLenOld))
         Else
            Replace04 = sExpression
         End If
         
         lPosExpr = 1
         lPosRepl = 1
         Do Until lNumReplaced = lCount
            lStart = InStr(lStart, sExpression, sOld, lCompare)
            If lStart Then
               ' replace: insert using fast Mid$ statement
               lStrLen = lStart - lPosExpr
               Mid$(Replace04, lPosRepl) = Mid$(sExpression, lPosExpr, lStrLen)
               lPosRepl = lPosRepl + lStrLen
               Mid$(Replace04, lPosRepl) = sNew
               ' next pos in Replace
               lPosRepl = lPosRepl + lLenNew
               ' next search pos in sExpression
               lStart = lStart + lLenOld
               ' store
               lPosExpr = lStart
               ' lCount
               lNumReplaced = lNumReplaced + 1
            Else
               Exit Do
            End If
         Loop
         If lPosExpr <= lLenExpr Then
            Mid$(Replace04, lPosRepl) = Mid$(sExpression, lPosExpr)
         End If
         
         ' trim unused target buffer
         Replace04 = Left$(Replace04, lLenExpr + lPosRepl - lPosExpr)
         
      End If
      
   Else
   
      Replace04 = sExpression
      
   End If
  
End Function
Author's comments:
Donald's comments: Interesting how the modifications bring 14% more speed!

top | charts


Replace05
submitted 24-Nov-2000 by Jost Schwider    vb-tec.de
Doping: none
Public Static Function Replace05( _
    ByRef Text As String, _
    ByRef sOld As String, _
    ByRef sNew As String, _
    Optional ByVal Start As Long = 1, _
    Optional ByVal Count As Long = 2147483647, _
    Optional ByVal Compare As VbCompareMethod = vbBinaryCompare _
  ) As String
' by Jost Schwider, jost@schwider.de, 20001124
  
  Dim OldLen As Long
  Dim NewLen As Long
  Dim TextLen As Long
  Dim CopyLen As Long
  Dim SourcePos As Long
  Dim BufferPos As Long
  Dim BufferPosNew As Long
  Dim BufferPosNext As Long
  Dim Buffer As String
  Dim BufferLen As Long
  
  OldLen = Len(sOld)
  If OldLen Then
  
    'Ersten Treffer bestimmen:
    Start = InStr(Start, Text, sOld, Compare)
    If Start Then
    
      NewLen = Len(sNew)
      If OldLen <> NewLen Then
        'Unterschiedliche Lńnge, also "basteln":
        
        SourcePos = 1
        BufferPos = 1
        For Count = 1 To Count
          'EinfŘge-Positionen bestimmen:
          CopyLen = Start - SourcePos
          BufferPosNew = BufferPos + CopyLen
          BufferPosNext = BufferPosNew + NewLen
          
          'Ggf. Buffer vergr÷▀ern:
          If BufferPosNext > BufferLen Then
            Buffer = Buffer & Space$(BufferPosNext)
            BufferLen = Len(Buffer)
          End If
          
          'Ggf. ▄bersprungendes kopieren:
          If CopyLen Then _
              Mid$(Buffer, BufferPos) = Mid$(Text, SourcePos, CopyLen)
          
          'EinzufŘgenden String kopieren:
          Mid$(Buffer, BufferPosNew) = sNew
          BufferPos = BufferPosNext
          
          'Nńchsten Treffer suchen:
          SourcePos = Start + OldLen
          Start = InStr(SourcePos, Text, sOld, Compare)
          If Start = 0 Then Exit For
        Next Count
        
        'Passenden Buffer-Ausschnitt zurŘckgeben:
        TextLen = Len(Text)
        If SourcePos <= TextLen Then 'Rest kopieren:
          BufferPosNext = TextLen - SourcePos + BufferPos
          
          'Ggf. Buffer vergr÷▀ern:
          If BufferPosNext > BufferLen Then
            Buffer = Buffer & Space$(BufferPosNext)
            BufferLen = Len(Buffer)
          End If
          
          Mid$(Buffer, BufferPos) = Mid$(Text, SourcePos)
          Replace05 = Left$(Buffer, BufferPosNext)
          Exit Function
        Else
          Replace05 = Left$(Buffer, BufferPos - 1)
          Exit Function
        End If
      
      Else
        'Gleiche Lńnge, also einfach Řberschreiben:
        
        Replace05 = Text
        For Count = 1 To Count
          Mid$(Replace05, Start) = sNew
          Start = InStr(Start + OldLen, Replace05, sOld, Compare)
          If Start = 0 Then Exit Function
        Next Count
        Exit Function
      
      End If
    
    Else 'Kein Treffer:
      Replace05 = Text
      Exit Function
    End If
  
  Else 'Suchstring ist leer:
    Replace05 = Text
    Exit Function
  End If

End Function
Author's comments:
Donald's comments: Note that the procedure is declared Static which reduces the need for expensive buffer space (re)allocation.

top | charts


Replace06
submitted 01-Dec-2000 by Donald Lessau  
Doping: none
Public Function Replace06( _
    Expression As String, _
    sOld As String, _
    sNew As String, _
    Optional ByVal Start As Long = 1, _
    Optional ByVal Count As Long = -1, _
    Optional Compare As VbCompareMethod = vbBinaryCompare) As String
' by Donald, donald@xbeat.net, 20001201 (rev 002)
' partly based on Replace05 by Jost Schwider

  Dim cntReplace As Long
  Dim lenOld As Long
  Dim lenNew As Long
  Dim lenCopy As Long
  Dim posSource As Long
  Dim posTarget As Long
  
  lenOld = Len(sOld)
  If lenOld Then
    
    ' get first match
    Start = InStr(Start, Expression, sOld, Compare)
    If Start Then
    
      ' set Count to "+inf" to get them all
      If Count < 0 Then Count = &H7FFFFFFF
      
      lenNew = Len(sNew)
      If lenOld = lenNew Then
        ' easy: simply overwrite Old with New
        Replace06 = Expression
        For Count = 1 To Count
          ' replace
          Mid$(Replace06, Start) = sNew
          ' find next
          Start = InStr(Start + lenOld, Expression, sOld, Compare)
          If Start = 0 Then Exit Function
        Next
      
      Else
        ' not so easy: gotta rebuild target from scratch
        '
        ' determine the number of actual replacements
        ' and calculate exact space needed for returned string
        posSource = Start
        For Count = 1 To Count
          cntReplace = cntReplace + 1
          ' find next
          posSource = InStr(posSource + lenOld, Expression, sOld, Compare)
          If posSource = 0 Then Exit For
        Next
        ' allocate space
        Replace06 = Space$(Len(Expression) + cntReplace * (lenNew - lenOld))
        '
        ' do the rebuild
        posSource = 1
        posTarget = 1
        For cntReplace = 1 To cntReplace
          lenCopy = Start - posSource
          ' insert source
          If lenCopy Then
            Mid$(Replace06, posTarget) = Mid$(Expression, posSource, lenCopy)
          End If
          ' insert new
          If lenNew Then
            Mid$(Replace06, posTarget + lenCopy) = sNew
          End If
          ' next pos in target
          posTarget = posTarget + lenCopy + lenNew
          ' find next
          posSource = Start + lenOld
          Start = InStr(posSource, Expression, sOld, Compare)
        Next
        ' insert source remainder
        If posTarget <= Len(Replace06) Then
          Mid$(Replace06, posTarget) = Mid$(Expression, posSource)
        End If
      End If
    
    Else
      ' no match
      Replace06 = Expression
    End If
  
  Else
    ' find string is zero-length
    Replace06 = Expression
  End If
  
End Function
Author's comments:
Donald's comments:

top | charts


Replace07
submitted 07-Dec-2000 by Guido Beckmann  
Doping: API, and reference to typelib BStrAPI.tlb (by G.Beckmann) - Download BStrAPI.tlb (2KB zipped, VB5-compatible).
Private Declare Function VarPtrArray& Lib "msvbvm60.dll" Alias "VarPtr" (ptr() As Any)
Private Declare Sub RtlMoveMemory Lib "kernel32" (dst As Any, src As Any, ByVal nBytes&)
Private Declare Sub RtlZeroMemory Lib "kernel32" (dst As Any, ByVal nBytes&)

Public Function Replace07( _ Text$, _ OldString$, _ NewString$, _ Optional ByVal Start& = 1, _ Optional ByVal Count& = -1, _ Optional ByVal Compare As VbCompareMethod = vbBinaryCompare _ ) As String ' by G.Beckmann, G.Beckmann@NikoCity.de, 20001207 Dim iLenOld&, iLenNew&, iLenDst& Dim pSrc&, pDst&, ccSrc&, ccDst&, c& Dim iAsc1%, iAsc2%, SA As BStrAPI.SAFEARRAY1D, aiResult%() If Start <= 0 Then Start = 1 Start = InStr(Start, Text, OldString, Compare) If Start Then If Count < 0 Then Count = &H7FFFFFFF iLenNew = Len(NewString) iLenOld = Len(OldString) Select Case iLenOld Case 0 Replace07 = Text Case iLenNew Replace07 = Text If iLenNew <= 2 Then SA.cDims = 1: SA.pvData = StrPtr(Replace07) SA.lLbound1D = 1: SA.cElements1D = &H7FFFFFFF ' Len(Text) SA.cbElements = 2 pSrc = VarPtrArray(aiResult) RtlMoveMemory ByVal pSrc, VarPtr(SA), 4 If iLenNew = 1 Then iAsc1 = AscW(NewString) Do aiResult(Start) = iAsc1 Start = InStr(Start + 1, Text, OldString, Compare) Count = Count - 1 Loop Until (Start = 0) Or (Count = 0) Else RtlMoveMemory iAsc1, ByVal StrPtr(NewString), 2 RtlMoveMemory iAsc2, ByVal StrPtr(NewString) + 2, 2 Do aiResult(Start) = iAsc1 aiResult(Start + 1) = iAsc2 Start = InStr(Start + 2, Text, OldString, Compare) Count = Count - 1 Loop Until (Start = 0) Or (Count = 0) End If RtlZeroMemory ByVal pSrc, 4 Else Do Mid$(Replace07, Start, iLenNew) = NewString Start = InStr(Start + iLenOld, Text, OldString, Compare) Count = Count - 1 Loop Until (Start = 0) Or (Count = 0) End If Case Else 'ilenNew <> iLenOld ccSrc = Start Do ccSrc = InStr(ccSrc + iLenOld, Text, OldString, Compare) c = c + 1 Loop Until (ccSrc = 0) Or (Count = c) iLenDst = Len(Text) + (iLenNew - iLenOld) * c Replace07 = BStrAPI.SysAllocStringLen(vbNullString, iLenDst) pSrc = StrPtr(Text) - 2 pDst = StrPtr(Replace07) - 2 ccSrc = 1 If iLenNew Then ccDst = 1 Do Count = Start - ccSrc If Count Then RtlMoveMemory ByVal pDst + ccDst + ccDst, _ ByVal pSrc + ccSrc + ccSrc, Count + Count ccDst = ccDst + Count End If Mid$(Replace07, ccDst, iLenNew) = NewString ccDst = ccDst + iLenNew ccSrc = Start + iLenOld Start = InStr(ccSrc, Text, OldString, Compare) c = c - 1 Loop Until c = 0 Count = iLenDst - (ccDst - 1) If Count > 0 Then RtlMoveMemory ByVal pDst + ccDst + ccDst, _ ByVal pSrc + ccSrc + ccSrc, Count + Count End If Else ccDst = 2 Do Count = (Start - ccSrc) * 2 If Count Then RtlMoveMemory ByVal pDst + ccDst, _ ByVal pSrc + ccSrc + ccSrc, Count ccDst = ccDst + Count End If ccSrc = Start + iLenOld Start = InStr(ccSrc, Text, OldString, Compare) c = c - 1 Loop Until c = 0 Count = iLenDst * 2 - (ccDst - 2) If Count > 0 Then RtlMoveMemory ByVal pDst + ccDst, _ ByVal pSrc + ccSrc + ccSrc, Count End If End If End Select Else Replace07 = Text End If End Function
Author's comments:
Donald's comments:

top | charts


Replace08
submitted 18-Dec-2000 by Jost Schwider    vb-tec.de
Doping: none
Replace08 comprises 2 procedures. View code.
Author's comments:
Donald's comments: Note that we have 2 procedures here: Replace08 wraps Replace08Bin.

top | charts


Replace09
submitted 18-Dec-2000 by Jost Schwider    vb-tec.de
Doping: none
Replace09 comprises 2 procedures. View code.
Author's comments:
Donald's comments: Note that we have 2 procedures here: Replace09 wraps Replace09Bin.

top | charts


Replace10
submitted 06-Jan-2001 by Olaf Schmidt  
Doping: API (cf. Dope'n'Declarations)
Replace10 is class-wrapped. View code.
Author's comments:
Donald's comments:

top | charts


Replace11
submitted 10-Dec-2001 by G.Beckmann  
Doping: API, TLB (cf. Dope'n'Declarations)
Replace11 is class-wrapped. View code.
Author's comments :
Donald's comments :

top | charts




VBspeed © 2000-10 by Donald Lessau