VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

basNamesAndDates

Lisa Z. Morgan  (1 Submission)   String Manipulation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

This is a .bas module that contains a few string manipulation functions I find useful in the real word. MakeProper replaces the limited proper case functions of VB with code that will format your string in title case, but not force mid-word capital letters to lower case. So "John Smith III" or "MacDonald" comes out correctly if typed are typed as "john smith III" or "macDonald". Initial letters of words are capitalized, but other letters are left as typed.
DateWord takes a date and converts it to the phrasing used on legal documents, so 1/1/2000 would return "1st day of January, 2000." MailingLabelText accepts a number of inputs and returns a UDT that offers many variations on the name and address for use in creating mailing labels and other reports containing name and address data. The proper business ettiquette is observed in that the presence of an honorific like "Esquire or MD" eliminates the "Mr." or "Dr."
Look for an update of this soon with more functions for string manipulation.
The other functions are used by these three.
LogError is pretty useful, too, come to think of it!
I don't care about winning any prizes, I just wanted to contribute to a site that has helped me out so much. Your feedback is welcome all the same. PLEASE STILL RATE THIS SO I WILL KNOW WHAT YOU THINK!

Inputs
MakeProper accepts a string. DateWord accepts a date. MailingLabelText accepts a number of string arguments, many optional.

Assumes
MakeProper Calls MakeWordsLowerCase and passes it several words that are commonly left lower case. You may wish to edit my selections.

Returns
All of these functions return strings.

Side Effects
Not tested under VB5.

Rate basNamesAndDates (10(10 Vote))
basNamesAndDates.bas

basNamesAndDates Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters