Visual Basic and Visual FoxPro functions to change the case of text

VBA

UCase(), LCase(), StrConv()

VFP

Upper(), Lower(), Proper()

Common Syntax Notes

The straightforward case-conversion routines work in the same way in both languages. In Visual FoxPro the Proper() function returns the string with the first letter of each word capitalised. In VBA the StrConv() function with a parameter of 3 does the same.

Note that neither of these last two functions are as useful as they might seem. You cannot use them to tidy up the poor capitalisation of a list of names because they blindly capitalise the first letter of each word. For example:

?Proper("MCCARTNEY")

will give you "Mccartney" and you'll get similarly unhelpful results from "DICAPRIO" and "IBM".

Finding characters  |  Text functions  |  Changing characters