|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function strPutString(strSource As String, strSubString As String, strDelimiter As String)
' Procedure : strPutString
' Description: Append a string to a library of strings.
' Copyright: Chris Greaves Inc
' Inputs: String library, string to be added, delimiter.
' Returns: Updated string library.
' Assumes: None.
' Side Effects: None.
' Tested: By the calls shown below.
' Return a string formed by loading a sub-string to the right-hand end of the source string.
' A pointer to the next available position will be created before the sub-string.
' A null pointer will be loaded past the end of the sub-string.
' Please see the test calls commented at the end of this procedure.
Dim lngNext As Long
lngNext = Len(strSource) + Len(strSubString) + 2 * Len(strDelimiter) ' allow for four delimiter characters
While lngNext <> Len(strSource) + Len(Trim(str(lngNext))) + Len(strSubString) + 2 * Len(strDelimiter)
lngNext = Len(strSource) + Len(Trim(str(lngNext))) + Len(strSubString) + 2 * Len(strDelimiter)
Wend
strPutString = strSource & Trim(str(lngNext)) & strDelimiter & strSubString & strDelimiter
'Sub TESTstrPutString()
'Dim strLib As String: strLib = ""
'strLib = strPutString(strLib, "alpha", ","): MsgBox strLib
'strLib = strPutString(strLib, "beta", ","): MsgBox strLib
'strLib = strPutString(strLib, "gamma", ","): MsgBox strLib
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |