Verified Software Products Company
792 Phillips Road || Arroyo Grande, CA 93420-5019 || Phone: (805) 489-5309
Email: bkandler@verisof.com
SERVICES FREEBIES TIPS and TRICKS ARTICLES LINKS HOME
Our Products

Classes
BMPBMP
CryptoCrypto
CSVStringsCSVStrings
DataLoggerDataLogger
DatesDates
DebugRecorderDebugRecorder
FileNameSetFileNameSet
FileSenderFileSender
RDOConnectMasterRDOConnectMaster
ReportAidsReportAids
ShellerSheller
StringSetStringSet
WEBUtilitiesWEBUtilities

Modules
DAOLibDAOLib
GlobalsGlobals
RegistryRegistry

Programs
BatcherBatcher
HTMLGenHTMLGen
KillTimeKillTime
TimedMessageTimedMessage
StringSet: This class implements a set of up to 26 substitutable strings and the Expand function which performs the substitutions within a string where the substitution points are identified by a shortcut character (% by default) and a single letter that identifies the string. PutString lets you set the value for a string while GetString lets you retrieve a previously set string. See the example below. Download me at once!
This piece of code is acting as a simple Mail Merge funtion. A file (Message.txt) containing a simple eMail message is being read, and processed once, for each person who is to receive the message. The message contains insertion points (StringSet references) for the eMail address, name, and phone number of the recipient. These insertion points are indicated, in the prototype message, as $A, $N, and $P.
Type ReplType                           'define UDT to hold recipient data
     eMail as String
     Name as String
     Phone as String
End Type
Dim Repl as ReplType
Dim ss as StringSet                     'declare our StringSet

  FileName = "Message.txt"
  Lngth = FileLen(FileName)             'get length of file
  Strg = Space(Lngth)                   'set up recepticle to hold file content
  FileNum = FreeFile                    'get an available file number

  Set ss = New StringSet                'create the object
  ss.ShortCut = "$"                     'set StringSet reference character to $
  Repl = NextAddressee                  'get first addressee information

  While Repl.eMail <> ""                'loop through all addressees
    Call ss.PutString("A", Repl.eMail)  'set up eMail address substitutions, $A
    Call ss.PutString("N", Repl.Name)   'set up name substitutions, $N
    Call ss.PutString("P", Repl.Phone)  'set up phone number substitutions, $P
    Open FileName For Binary As FileNum 'open the file
    Get #FileNum, , Strg                'read entire file into Strg
    Close #FileNum                      'close the file
    Msg = ss.Expand(Strg)               'perform the substitutions
    Call SendMessage(Msg)               'send out the eMail message
    Repl = NextAddressee                'get next addressee information
  Wend
End Sub
This site designed by William D. Kandler (bkandler@verisof.com)
Updated: 6/29/01