Tip Bank

DevX - Software Development Resource

Virtual and Non-Virtual

Question: Why would a call to a virtual function execute slower than a call to a non-virtual function? Answer: Because the call is resolved through an additional level of indirection?instead

DevX - Software Development Resource

Creating a Client E-mail List

Question: I am trying to create a client e-mail listing to go out to all our company clients. What would be the easiest way to do this? Answer: The easiest

DevX - Software Development Resource

ReplaceWord – Replace whole words

‘ Replace a whole wordFunction ReplaceWord(Source As String, Find As String, ReplaceStr As String, _ Optional ByVal Start As Long = 1, Optional Count As Long = -1, _ Optional

DevX - Software Development Resource

InstrWord – Search a whole word

‘ Return the next occurrence of a whole wordFunction InstrWord(start, Text, search, compareMethod) As Long Dim index As Long Dim charcode As Integer ‘ assume the search fails InstrWord =

DevX - Software Development Resource

Soundex – Determine the phonetic code of a word

‘ The Soundex code of an alphabetical string” you can use Soundex code for phonetic searches’ Beware: this isn’t bullet-proof!” UPDATE: this version corrects a bug in the original routine’

DevX - Software Development Resource

Drop the Parentheses in a VBScript Sub

Beginners are sometimes stymied when they get error messages on code that works perfectly elsewhere. For example, this code produces the error message, “Cannot use parentheses when calling a Sub”: